golang easyjson使用 1.先安装easyjson go get -u github.com/mailru/easyjson/ 2.在结构体上加//easyjson:json的注解 //easyjson:json type School struct { Name string `jso ...
分类:
Web程序 时间:
2021-04-20 14:21:08
阅读次数:
0
goconvery基本使用 (1.)项目地址 https://github.com/smartystreets/goconvery (2.)安装 go get -u github.com/smartystreets/goconvery/convery (3.)启动UI界面 $GOPATH/bin/g ...
分类:
其他好文 时间:
2021-04-20 14:09:28
阅读次数:
0
IOC(inversion of control)控制反转,这是一种比较重要的解决面向对象设计耦合问题的方式,是Spring框架的核心之一,控制反转一般分为两大类型,一种是依赖注入(dependecy injection)简称DI,另一种是依赖查找(dependency lookup),依赖注入的应 ...
分类:
其他好文 时间:
2021-04-20 14:06:28
阅读次数:
0
#! /bin/bash # @author # @breif auto ssh function show_usage(){ echo -e " This is Usage " echo -e " -h: which host to go,for example dev041" } functio ...
分类:
其他好文 时间:
2021-04-19 15:50:26
阅读次数:
0
这里用go to 来模拟汇编他们的区别 while 代码 int i = 0; while (i < 100) { i++; } goto 实现while int i = 0; WHILE_BEGIN: if (i < 100) { goto WHILE_END; } i++; goto WHILE ...
分类:
其他好文 时间:
2021-04-19 15:45:52
阅读次数:
0
包package 每个Go程序都是由包构成的, 程序从main包开始运行, 按照约定, 报名与导入路径的最后一个元素一致, 例如"match/rand"包中的源码均以package rand语句开始 导入 单行导入 import "fmt" import "match" 括号分组导入(注意没有逗号) ...
分类:
编程语言 时间:
2021-04-19 15:36:28
阅读次数:
0
关于整型切片的初始化,下面正确的是: s := make([]int) s := make([]int, 0) s := make([]int, 5, 10) s := []int{1, 2, 3, 4, 5} [答案]: BCD [解析&更多]: 再在使用make初始化切片的时候,除了类型,长度也 ...
分类:
其他好文 时间:
2021-04-19 15:15:15
阅读次数:
0
[Luogu P6822PA2012]Tax] (http://www.luogu.com.cn/problem/P6822") All right. Let's go! 题目描述 给出一个 n 个点 m 条边的无向图,经过一个点的代价是进入和离开这个点的两条边的边权的较大值,求从起点 1 到点 n ...
分类:
其他好文 时间:
2021-04-19 15:06:50
阅读次数:
0
前言: 手写GO用反射读取ini配置文件。 实例代码: package main import ( "errors" "fmt" "io/ioutil" "reflect" "strconv" "strings" ) // ini配置文件解析器 // MysqlConfig MySQL配置结构体 t ...
分类:
其他好文 时间:
2021-04-19 15:03:58
阅读次数:
0
mac 上build go 如果想要在centos上面执行 必须使用下面的方式 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o hello hello.go 不然会报错 :cannot execute binary file ...
分类:
其他好文 时间:
2021-04-19 14:58:20
阅读次数:
0