ZhangZhihui's Blog  
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 102 下一页

2023年10月18日

摘要: Problem: You want to speed up testing by running tests in parallel. Solution: Use the t.Parallel function to enable tests or subtests to run in parall 阅读全文
posted @ 2023-10-18 16:52 ZhangZhihuiAAA 阅读(25) 评论(0) 推荐(0)
 
摘要: Problem: You want to create subtests within a test function to have finer control over test cases. Solution: Use the t.Run function to create subtests 阅读全文
posted @ 2023-10-18 16:24 ZhangZhihuiAAA 阅读(12) 评论(0) 推荐(0)
 
摘要: Problem: You want to set up data and an environment for testing and tear it down after the test is run. Solution: You can create helper functions or u 阅读全文
posted @ 2023-10-18 09:53 ZhangZhihuiAAA 阅读(13) 评论(0) 推荐(0)

2023年10月17日

摘要: Problem: You want to make an HTTP request to a web server. Solution: Use the net/http package to make an HTTP request. HTTP is a request-respond proto 阅读全文
posted @ 2023-10-17 22:26 ZhangZhihuiAAA 阅读(24) 评论(0) 推荐(0)
 
摘要: Problem: You want to use Go’s templating system to create a web application. Solution: Use the html/template package to create a web application. pack 阅读全文
posted @ 2023-10-17 21:49 ZhangZhihuiAAA 阅读(18) 评论(0) 推荐(0)
 
摘要: Problem: You want to serve your web application through HTTPS. Solution: Use the http.ListenAndServeTLS function to serve your web application through 阅读全文
posted @ 2023-10-17 21:23 ZhangZhihuiAAA 阅读(21) 评论(0) 推荐(0)
 
摘要: Problem: You want to create a simple web service API that returns JSON. Solution: Use the net/http package to create a web service API and the encodin 阅读全文
posted @ 2023-10-17 20:08 ZhangZhihuiAAA 阅读(19) 评论(0) 推荐(0)
 
摘要: Problem: You want to serve static files such as images, CSS, and JavaScript files. Solution: Use the http.FileServer function to serve static files. f 阅读全文
posted @ 2023-10-17 19:45 ZhangZhihuiAAA 阅读(23) 评论(0) 推荐(0)
 
摘要: Problem: You want to upload a file to a web application. Solution: Use the net/http package to create a web application and the io package to read the 阅读全文
posted @ 2023-10-17 15:00 ZhangZhihuiAAA 阅读(14) 评论(0) 推荐(0)
 
摘要: Problem: You want to process data submitted from HTML forms. Solution: Use the Form field of http.Request or the FormValue method to access the data s 阅读全文
posted @ 2023-10-17 14:50 ZhangZhihuiAAA 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 102 下一页