chore: better Go

main
sudo pacman -Syu 2022-06-28 16:59:29 +07:00
parent f1e7b934da
commit 1f9660d9bc
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
2 changed files with 10 additions and 18 deletions

View File

@ -22,30 +22,12 @@ go mod tidy
go mod vendor
```
Outside modules:
```sh
GOMODULE11=on go get example.com/foo/bar
```
Update go version:
```sh
go mod edit -go=1.XY
```
Replace module path and version pair:
```sh
go mod edit -replace old[@v]=new[@v]
```
Drop replace module path:
```sh
go mod edit -dropreplace old[@v]
```
In world of corporation, we work with private repository, add to `~/.bashrc`, `~/.zshrc`:
```sh

View File

@ -11,3 +11,13 @@ Unwrap error:
```go
rootErr := errors.Unwrap(err)
```
Compare error:
```go
// Don't
if err == CustomErr
// Do
if errors.Is(err, CustomErr)
```