ZhangZhihui's Blog  
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 116 下一页

2024年11月15日

摘要: package main import ( "fmt" ) type A struct { field1 string } type B struct { field1 string } func main() { a := A{ field1: "aaa", } b := B(a) fmt.Pri 阅读全文
posted @ 2024-11-15 16:30 ZhangZhihuiAAA 阅读(14) 评论(0) 推荐(0)
 
摘要: func (app *application) exampleHandler(w http.ResponseWriter, r *http.Request) { var input struct { Foo string `json:"foo"` } // Use io.ReadAll() to r 阅读全文
posted @ 2024-11-15 08:27 ZhangZhihuiAAA 阅读(34) 评论(0) 推荐(0)
 
摘要: 阅读全文
posted @ 2024-11-15 08:21 ZhangZhihuiAAA 阅读(12) 评论(0) 推荐(0)

2024年11月14日

摘要: 阅读全文
posted @ 2024-11-14 20:33 ZhangZhihuiAAA 阅读(19) 评论(0) 推荐(0)
 
摘要: func (app *application) writeJSON(w http.ResponseWriter, status int, data envelope, headers http.Header) error { js, err := json.MarshalIndent(data, " 阅读全文
posted @ 2024-11-14 18:52 ZhangZhihuiAAA 阅读(28) 评论(0) 推荐(0)
 
摘要: We’re going to use the popular third-party package httprouter as the router for our application, instead of using http.ServeMux from the standard-libr 阅读全文
posted @ 2024-11-14 11:51 ZhangZhihuiAAA 阅读(24) 评论(0) 推荐(0)
 
摘要: API versioning APIs which support real-world businesses and users often need to change their functionality and endpoints over time — sometimes in a ba 阅读全文
posted @ 2024-11-14 11:34 ZhangZhihuiAAA 阅读(16) 评论(0) 推荐(0)
 
摘要: { "workbench.startupEditor": "none", "[go]": { "editor.insertSpaces": true, "editor.formatOnSave": false }, "editor.fontSize": 16, "terminal.integrate 阅读全文
posted @ 2024-11-14 09:21 ZhangZhihuiAAA 阅读(25) 评论(0) 推荐(0)
 
摘要: Method URL Pattern Action GET /v1/healthcheck Show application health and version informationGET /v1/movies Show the details of all moviesPOST /v1/mov 阅读全文
posted @ 2024-11-14 08:52 ZhangZhihuiAAA 阅读(17) 评论(0) 推荐(0)
 
摘要: $ mkdir -p bin cmd/api internal migrations remote $ touch Makefile $ touch cmd/api/main.go At this point your project directory should look exactly li 阅读全文
posted @ 2024-11-14 08:42 ZhangZhihuiAAA 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 116 下一页