电商网站设计图,景洪市新农村建设网站,做网站襄樊,ppt模板在哪里找今天是开始学go的第x天#xff0c;前些日子看了看语言#xff0c;今天找一个web开发来跟着学#xff0c;记录一下遇到的问题#xff0c;方便以后复习查阅。
视频看的是https://www.bilibili.com/video/BV1gJ411p7xC?p3vd_sourceab5bdbd04f4142027c66d604d5285204 视…今天是开始学go的第x天前些日子看了看语言今天找一个web开发来跟着学记录一下遇到的问题方便以后复习查阅。
视频看的是https://www.bilibili.com/video/BV1gJ411p7xC?p3vd_sourceab5bdbd04f4142027c66d604d5285204 视频中用的是goland我用的vs
如何在vs中建一个项目
https://blog.csdn.net/sepnineth/article/details/125153354
这也是为了解决一个报错
go.mod file not found in current directory or any parent directory.go get is no longer supported outside a module.To build and install a command, use go install with a version,like go install example.com/cmdlatestFor more information, see https://golang.org/doc/go-get-install-deprecationor run go help get or go help install.
因为下载gin的时候会报错,就是这个命令go get -u github.com/gin-gonic/gin
初次尝试go写一个网页还是挺有意思的
package mainimport (fmtnet/http
)func sayHello(w http.ResponseWriter, r *http.Request) {_, _ fmt.Fprintln(w, Hello jzy)
}func main() {http.HandleFunc(/hello, sayHello)err : http.ListenAndServe(:9090, nil)if err ! nil {fmt.Printf(http server failed, err:%v\n, err)return}
}