markdown Golang cheatsheet #golang #cheatsheet

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Golang cheatsheet #golang #cheatsheet相关的知识,希望对你有一定的参考价值。

# mod

## Migrating from dep to Go 1.11 modules
> https://blog.callr.tech/migrating-from-dep-to-go-1.11-modules/
```
- move your code outside of GOPATH
- go mod init [module path]: this will import dependencies from Gopkg.lock.
- go mod tidy: this will remove unnecessary imports, and add indirect ones.
- rm -fr vendor/
- go build: is everthing ok?
- rm -f Gopkg.lock Gopkg.toml
- git commit -m 'chore(dep): migrated from dep to Go 1.11 modules'
```

## Clearing the module cache
> https://github.com/golang/go/issues/27238
```go
go clean -modcache
```

以上是关于markdown Golang cheatsheet #golang #cheatsheet的主要内容,如果未能解决你的问题,请参考以下文章

markdown 去(Golang)GOOS和GOARCH

markdown 兽医问起Golang

markdown Golang Essentials

markdown 去(Golang)GOOS和GOARCH

markdown golang / dep的简明指南

markdown 去(Golang)GOOS和GOARCH