摘要:
zzh@ZZHPC:~$ help set set: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] Set or unset values of shell options and positional parameters. Ch
阅读全文
posted @ 2024-06-16 22:47
ZhangZhihuiAAA
阅读(24)
推荐(0)
摘要:
You can remove a module from go.mod using none as follows: $ go get github.com/rabbitmq/amqp091-go@nonego: removed github.com/rabbitmq/amqp091-go v1.8
阅读全文
posted @ 2024-06-16 17:18
ZhangZhihuiAAA
阅读(23)
推荐(0)
摘要:
docker-compose.yml: services: rabbitmq: image: 'rabbitmq:3.13-management' container_name: rabbitmq ports: - '5672:5672' - '15672:15672' environment: A
阅读全文
posted @ 2024-06-14 15:50
ZhangZhihuiAAA
阅读(11)
推荐(0)
摘要:
server.go: package main import ( "fmt" "log" "net/http" "os" "time" "github.com/gorilla/websocket" ) var port = ":1234" var upgrader = websocket.Upgra
阅读全文
posted @ 2024-06-13 21:29
ZhangZhihuiAAA
阅读(17)
推荐(0)
摘要:
package main import ( "context" "fmt" "os" "strconv" "time" "golang.org/x/sync/semaphore" ) func worker(n int) int { square := n * n time.Sleep(time.S
阅读全文
posted @ 2024-06-13 20:26
ZhangZhihuiAAA
阅读(26)
推荐(0)
摘要:
Reading from a closed channel returns the zero value of its data type. However, if you try to write to a closed channel, your program is going to cras
阅读全文
posted @ 2024-06-13 19:36
ZhangZhihuiAAA
阅读(14)
推荐(0)
摘要:
pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with n
阅读全文
posted @ 2024-06-12 16:55
ZhangZhihuiAAA
阅读(13)
推荐(0)
摘要:
package main import ( "bufio" "fmt" "io" "os" ) func main() { buffer := []byte("Data to write\n") f1, err := os.Create("f1.txt") if err != nil { fmt.P
阅读全文
posted @ 2024-06-12 14:37
ZhangZhihuiAAA
阅读(13)
推荐(0)
摘要:
The purpose of the /dev/random system device is to generate random data, which you might use to test your programs or, in this case, as the seed for a
阅读全文
posted @ 2024-06-12 14:13
ZhangZhihuiAAA
阅读(14)
推荐(0)
摘要:
package main import ( "bufio" "fmt" "io" "os" ) func lineByLine(file string) error { f, err := os.Open(file) if err != nil { return err } defer f.Clos
阅读全文
posted @ 2024-06-12 10:53
ZhangZhihuiAAA
阅读(15)
推荐(0)