-
Notifications
You must be signed in to change notification settings - Fork 6
Random
zelenko edited this page Oct 13, 2023
·
16 revisions
test this code
resp, err := http.Get("http://example.com/")
...
resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf)
...
resp, err := http.PostForm("http://example.com/form",
url.Values{"key": {"Value"}, "id": {"123"}})
update all packages: go get -u all
format code: gofmt -s -w .
Working on core infrastructure and user facing applications.
https://gitmemory.com/zelenko/go
- https://github.com/SchoofsKelvin/vscode-sshfs
- https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
- https://marketplace.visualstudio.com/items?itemName=rokoroku.vscode-theme-darcula
- https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go
- http://www.catonmat.net/
- https://onlinerandomtools.com/generate-random-password
- https://github.com/yt-dlp/yt-dlp/
Struct can have blank fields (try in playground)
package main
import "fmt"
func main() {
for _, book := range []struct {
title string
published uint16
}{
{title: "Go Recipes"}, // title only given
{"Go in Action", 2016}, // title and year given
} {
fmt.Printf(book.title+":\t%+v\n", book)
}
}
// Go Recipes: {title:Go Recipes published:0}
// Go in Action: {title:Go in Action published:2016}
go get golang.org/x/tools/cmd/present
go build golang.org/x/tools/cmd/present
func validInput(input string) bool {
switch input {
case "Option1", "OPtion2", "valid1", "valid2", "valid3":
return true
}
return false
}
func alphaNumeric(input string) string {
reg, _ := regexp.Compile("[^a-zA-Z0-9]+")
return reg.ReplaceAllString(input, "")
}
newNumber, err := strconv.ParseUint("100", 10, 64)