go实现词法分析器

笔记  Go 

package mainimport ("bufio""fmt""os""unicode")var keywords = map[string]int{"begin": 1,"if"

Go 接口

笔记  Go 

Go 接口接口定义Go语言提倡面向接口编程。指针接收者实现接口package mainimport "fmt"// 接口定义type USB interface {Connect()Disconnect()}type Laptop struct {name stringve

Go语言 Web框架Gin

笔记  Go 

Go语言 Web框架Gin返回helloworldpackage main import ("net/http" "github.com/gin-gonic/gin") func main() {router := gin.Default()router

Go文件读写

笔记  Go 

参考文档:https://www.liwenzhou.com/posts/Go/file/读取文件package main import ( "fmt" "io" "os") func main() {