随笔分类 -  编程语言 / golang

摘要:package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, World 阅读全文
posted @ 2023-01-20 16:06 mingtian是吧 阅读(379) 评论(0) 推荐(0)
摘要:创建被调用的包 mkdir test cd test go mod init example.com/test cat test/test.go package test import "fmt" // func 定义函数 // Hello 函数名 // (name string) 可以接受一个字符 阅读全文
posted @ 2022-12-08 23:03 mingtian是吧 阅读(32) 评论(0) 推荐(0)
摘要:golang,本节目标为安装golang,并完成hello world 系统环境为win11,下载地址 安装后检查版本 PS C:\Users\pc> go.exe version go version go1.19.3 windows/amd64 设置国内包加速器 C:\> $env:GO111M 阅读全文
posted @ 2022-12-01 13:55 mingtian是吧 阅读(97) 评论(0) 推荐(0)