update goctl to go 1.16 for io/fs usage (#1571)

* update goctl to go 1.16 for io/fs usage

* feat: support pg serial type for auto_increment (#1563)

* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>

* chore: format code

Co-authored-by: toutou_o <33993460+kurimi1@users.noreply.github.com>
Co-authored-by: kurimi1 <d0n41df@gmail.com>
This commit is contained in:
Kevin Wan
2022-02-24 13:58:53 +08:00
committed by GitHub
parent 3b07ed1b97
commit e0454138e0
13 changed files with 28 additions and 19 deletions

View File

@@ -9,8 +9,10 @@ import (
"github.com/zeromicro/go-zero/tools/goctl/util/stringx"
)
var ErrInvalidKVExpression = errors.New(`invalid key-value expression`)
var ErrInvalidKVS = errors.New("the length of kv must be a even number")
var (
ErrInvalidKVExpression = errors.New(`invalid key-value expression`)
ErrInvalidKVS = errors.New("the length of kv must be a even number")
)
type KV []interface{}
@@ -193,7 +195,7 @@ func (m *SortedMap) Copy() *SortedMap {
}
func (m *SortedMap) Format() []string {
var format = make([]string, 0)
format := make([]string, 0)
m.Range(func(key, value interface{}) {
format = append(format, fmt.Sprintf("%s=%s", key, value))
})

View File

@@ -143,5 +143,5 @@ func WriteEnv(kv []string) error {
return err
}
envFile := filepath.Join(defaultGoctlHome, envFileDir)
return ioutil.WriteFile(envFile, []byte(strings.Join(goctlEnv.Format(), "\n")), 0777)
return ioutil.WriteFile(envFile, []byte(strings.Join(goctlEnv.Format(), "\n")), 0o777)
}