使用goland写struct,定义json tag
默认是用snake_case
命名,也就是下划线写法
type Hello struct {
HelloWorld string `json:"hello_world"`
}
把表达式由camelCase(fieldName())
改为camelCase(fieldName())
即可修改为小驼峰
type Hello struct {
HelloWorld string `json:"helloWorld"`
}
使用goland写struct,定义json tag
默认是用snake_case
命名,也就是下划线写法
type Hello struct {
HelloWorld string `json:"hello_world"`
}
把表达式由camelCase(fieldName())
改为camelCase(fieldName())
即可修改为小驼峰
type Hello struct {
HelloWorld string `json:"helloWorld"`
}