摘要:
frank@ZZHPC:~/zproject/GO-CLI/healthcheck$ go get -u github.com/olekukonko/tablewriter go: downloading github.com/olekukonko/tablewriter v1.1.4 go: do
阅读全文
posted @ 2026-03-23 19:41
ZhangZhihuiAAA
阅读(1)
推荐(0)
摘要:
Gemini said It’s a common point of confusion because, in older versions of Go, these two commands overlapped quite a bit. However, in modern Go (1.16+
阅读全文
posted @ 2026-03-23 10:36
ZhangZhihuiAAA
阅读(2)
推荐(0)
摘要:
frank@ZZHPC:~/zproject/GO-CLI$ go get -u github.com/spf13/cobra go: downloading github.com/inconshreveable/mousetrap v1.1.0 go: downloading github.com
阅读全文
posted @ 2026-03-23 10:19
ZhangZhihuiAAA
阅读(2)
推荐(0)
摘要:
package main import ( "flag" "fmt" "log" "os" ) func main() { content := flag.String("content", "", "Content to write to the file") flag.Usage = func(
阅读全文
posted @ 2026-03-22 20:24
ZhangZhihuiAAA
阅读(2)
推荐(0)
摘要:
package main import ( "flag" "fmt" "io" "log" "net/http" "os" "strings" "time" ) type URLList []string func (list *URLList) String() string { return f
阅读全文
posted @ 2026-03-22 12:03
ZhangZhihuiAAA
阅读(2)
推荐(0)
摘要:
frank@ZZHPC:~/zproject/REST-API$ go mod init zrestapi go: creating new go.mod: module zrestapi frank@ZZHPC:~/zproject/REST-API$ go get -u github.com/g
阅读全文
posted @ 2026-03-19 16:42
ZhangZhihuiAAA
阅读(5)
推荐(0)
摘要:
package main import "fmt" func main() { numbers := []int{1, 10, 15} sum := sumup(1, 10, 15, 40, -5) anotherSum := sumup(1, numbers...) fmt.Println(sum
阅读全文
posted @ 2026-03-19 16:12
ZhangZhihuiAAA
阅读(3)
推荐(0)
摘要:
package main import "fmt" func main() { numbers := []int{1, 2, 3} double := createTransformer(2) triple := createTransformer(3) transformed := transfo
阅读全文
posted @ 2026-03-19 16:04
ZhangZhihuiAAA
阅读(4)
推荐(0)
摘要:
package main import "fmt" func main() { userNames := make([]string, 2, 3) fmt.Println(len(userNames), cap(userNames)) userNames = append(userNames, "M
阅读全文
posted @ 2026-03-19 11:00
ZhangZhihuiAAA
阅读(3)
推荐(0)
摘要:
package main import "fmt" func main() { result1 := add(1, 2) fmt.Println(result1) result2 := add("abc", "def") fmt.Println(result2) } func add[T int |
阅读全文
posted @ 2026-03-19 10:04
ZhangZhihuiAAA
阅读(3)
推荐(0)