随笔分类 - Go程序设计
记录学习过程中的点点滴滴
摘要:package mypackage import ( "encoding/json" "fmt" "io/ioutil" "log" "os" "database/sql" _ "github.com/lib/pq" ) func LoadConfig(path string) Config { j
阅读全文
摘要:package main import ( "encoding/json" "fmt" "io/ioutil" "os" "strconv" "time" ) type ResponseStruct struct { Signs []Sign `json:"signs"` } type Sign s
阅读全文
摘要:#include <iostream> int main() { int v[] = {1, 2, 3, 4, 5}; for(auto& x:v) std::cout<<x<<" "; std::cout<<std::endl; return 0;} We use auto where we do
阅读全文
摘要:package main import "fmt" func makeSet() *customSet { return &customSet{ container: make(map[string]struct{}), } } type customSet struct { container m
阅读全文
摘要:package main import ( "fmt" "log" "os" "sync" "strings" "io/ioutil" "encoding/json" ) type demo struct { } type creStruct struct { Name string `json:"
阅读全文
摘要:package main import ( "fmt" "os" ) func main() { var s, sep string for i := 1; i < len(os.Args); i++ { s += sep + os.Args[i] sep = " " } fmt.Println(s
阅读全文