随笔分类 -  网络编程

摘要:数据绑定和解析 1 package main 2 3 import ( 4 "net/http" 5 6 "github.com/gin-gonic/gin" 7 ) 8 9 type Login struct { 10 User string `form: "username" json: "us 阅读全文
posted @ 2019-11-28 12:22 尘归风 阅读(245) 评论(0) 推荐(0)
摘要:1 package main 2 3 import "github.com/gin-gonic/gin" 4 5 func main() { 6 r := gin.Default() 7 r.GET("/ping", func(c *gin.Context) { 8 c.JSON(200, gin. 阅读全文
posted @ 2019-11-26 15:49 尘归风 阅读(257) 评论(0) 推荐(0)
摘要:1 package main 2 3 import ( 4 "fmt" 5 "net" 6 "os" 7 ) 8 9 func main() { 10 if len(os.Args) != 2 { 11 fmt.Fprintf(os.Stderr, "Usage: %s ip-addr\n", os.Args[0]) 12 ... 阅读全文
posted @ 2019-10-27 22:29 尘归风 阅读(129) 评论(0) 推荐(0)