ZhangZhihui's Blog  
上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 102 下一页

2023年9月29日

摘要: Problem: You want to create custom errors to communicate more information about the error encountered. Solution: Create a new string - based error or 阅读全文
posted @ 2023-09-29 10:11 ZhangZhihuiAAA 阅读(20) 评论(0) 推荐(0)
 
摘要: Problem: You want to use multiple versions of the same dependent packages in your code. Solution: Use the replace directive in the go.mod file to rena 阅读全文
posted @ 2023-09-29 09:17 ZhangZhihuiAAA 阅读(89) 评论(0) 推荐(0)
 
摘要: Problem: You want to use local versions of the dependent packages. Solution: Set up Go to use a vendor directory by running go mod vendor. Local versi 阅读全文
posted @ 2023-09-29 08:53 ZhangZhihuiAAA 阅读(11) 评论(0) 推荐(0)

2023年9月27日

摘要: package main import ( "fmt" "sync" "time" ) var workers = 3 func processItem(input <-chan int, output chan<- int, wg *sync.WaitGroup) { for { fmt.Prin 阅读全文
posted @ 2023-09-27 16:56 ZhangZhihuiAAA 阅读(14) 评论(0) 推荐(0)
 
摘要: main.go: package main import "fmt" func main() { ch := make(chan int) ch <- 1 a := <-ch fmt.Println(a) } Got error: zzh@ZZHPC:/zdata/MyPrograms/Go/tes 阅读全文
posted @ 2023-09-27 16:18 ZhangZhihuiAAA 阅读(33) 评论(0) 推荐(0)

2023年9月26日

摘要: Within the Kubernetes deployment environment, applications will actually be sent the SIGTERM signal first if it has been decided the pod holding the a 阅读全文
posted @ 2023-09-26 23:00 ZhangZhihuiAAA 阅读(11) 评论(0) 推荐(0)

2023年9月25日

摘要: The concept of microservices is simply breaking a single large potential service into many smaller services that work together, hence, the name. One v 阅读全文
posted @ 2023-09-25 19:45 ZhangZhihuiAAA 阅读(32) 评论(0) 推荐(0)
 
摘要: docker-compose.yaml: version: '3.3' services: nginx: image: nginx:latest ports: - 8080:80 With regards to the preceding docker-compose file, we have t 阅读全文
posted @ 2023-09-25 11:35 ZhangZhihuiAAA 阅读(105) 评论(0) 推荐(0)
 
摘要: Install using the repository Set up the repository. Find distro-specific instructions in: Ubuntu | CentOS | Debian | Raspberry Pi OS | Fedora | RHEL | 阅读全文
posted @ 2023-09-25 10:50 ZhangZhihuiAAA 阅读(60) 评论(0) 推荐(0)

2023年9月23日

摘要: Dockerfile: FROM golang:latest WORKDIR /app ADD . . RUN go env -w GOPROXY=https://goproxy.io,direct RUN go get RUN go build -o app . CMD ["/app/app"] 阅读全文
posted @ 2023-09-23 17:41 ZhangZhihuiAAA 阅读(788) 评论(0) 推荐(1)
上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 102 下一页