From bfb45d95906bb99d42a22eef5d5cb5e7df11885a Mon Sep 17 00:00:00 2001 From: Tom <73077675+tmzane@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:39:40 +0300 Subject: [PATCH] update package links --- README.md | 26 +++++++++++++------------- builtins.go | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 628a311..54c2744 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ The rational from [Uber Style Guide][1]: The following packages are supported out of the box: -* [`encoding/json`][2] -* [`encoding/xml`][3] -* [`gopkg.in/yaml.v3`][4] -* [`github.com/BurntSushi/toml`][5] -* [`github.com/mitchellh/mapstructure`][6] -* [`github.com/jmoiron/sqlx`][7] +* [encoding/json][2] +* [encoding/xml][3] +* [gopkg.in/yaml.v3][4] +* [github.com/BurntSushi/toml][5] +* [github.com/mitchellh/mapstructure][6] +* [github.com/jmoiron/sqlx][7] In addition, any [custom package](#custom-packages) can be added to the list. @@ -69,14 +69,14 @@ When using `sloglint` standalone, pass the options as flags. ### Custom packages To report a custom function, you need to add its description to `.golangci.yml`. -The following is an example of adding support for the `hclsimple.DecodeFile` function from [`github.com/hashicorp/hcl`][11]: +The following is an example of adding support for [`hclsimple.Decode`][11]: ```yaml linters-settings: musttag: functions: # The full name of the function, including the package. - - name: github.com/hashicorp/hcl/v2/hclsimple.DecodeFile + - name: github.com/hashicorp/hcl/v2/hclsimple.Decode # The struct tag whose presence should be ensured. tag: hcl # The position of the argument to check. @@ -92,11 +92,11 @@ musttag -fn="github.com/hashicorp/hcl/v2/hclsimple.DecodeFile:hcl:2" ./... [1]: https://github.com/uber-go/guide/blob/master/style.md#use-field-tags-in-marshaled-structs [2]: https://pkg.go.dev/encoding/json [3]: https://pkg.go.dev/encoding/xml -[4]: https://github.com/go-yaml/yaml -[5]: https://github.com/BurntSushi/toml -[6]: https://github.com/mitchellh/mapstructure -[7]: https://github.com/jmoiron/sqlx +[4]: https://pkg.go.dev/gopkg.in/yaml.v3 +[5]: https://pkg.go.dev/github.com/BurntSushi/toml +[6]: https://pkg.go.dev/github.com/mitchellh/mapstructure +[7]: https://pkg.go.dev/github.com/jmoiron/sqlx [8]: https://golangci-lint.run [9]: https://github.com/go-simpler/musttag/releases [10]: https://golangci-lint.run/usage/linters/#musttag -[11]: https://github.com/hashicorp/hcl +[11]: https://pkg.go.dev/github.com/hashicorp/hcl/v2/hclsimple#Decode diff --git a/builtins.go b/builtins.go index c5e0b52..3305513 100644 --- a/builtins.go +++ b/builtins.go @@ -54,7 +54,7 @@ var builtins = []Func{ ifaceWhitelist: []string{"encoding/xml.Unmarshaler", "encoding.TextUnmarshaler"}, }, - // https://github.com/go-yaml/yaml + // https://pkg.go.dev/gopkg.in/yaml.v3 { Name: "gopkg.in/yaml.v3.Marshal", Tag: "yaml", ArgPos: 0, ifaceWhitelist: []string{"gopkg.in/yaml.v3.Marshaler"}, @@ -72,7 +72,7 @@ var builtins = []Func{ ifaceWhitelist: []string{"gopkg.in/yaml.v3.Unmarshaler"}, }, - // https://github.com/BurntSushi/toml + // https://pkg.go.dev/github.com/BurntSushi/toml { Name: "github.com/BurntSushi/toml.Unmarshal", Tag: "toml", ArgPos: 1, ifaceWhitelist: []string{"github.com/BurntSushi/toml.Unmarshaler", "encoding.TextUnmarshaler"}, @@ -98,13 +98,13 @@ var builtins = []Func{ ifaceWhitelist: []string{"github.com/BurntSushi/toml.Unmarshaler", "encoding.TextUnmarshaler"}, }, - // https://github.com/mitchellh/mapstructure + // https://pkg.go.dev/github.com/mitchellh/mapstructure {Name: "github.com/mitchellh/mapstructure.Decode", Tag: "mapstructure", ArgPos: 1}, {Name: "github.com/mitchellh/mapstructure.DecodeMetadata", Tag: "mapstructure", ArgPos: 1}, {Name: "github.com/mitchellh/mapstructure.WeakDecode", Tag: "mapstructure", ArgPos: 1}, {Name: "github.com/mitchellh/mapstructure.WeakDecodeMetadata", Tag: "mapstructure", ArgPos: 1}, - // https://github.com/jmoiron/sqlx + // https://pkg.go.dev/github.com/jmoiron/sqlx {Name: "github.com/jmoiron/sqlx.Get", Tag: "db", ArgPos: 1}, {Name: "github.com/jmoiron/sqlx.GetContext", Tag: "db", ArgPos: 2}, {Name: "github.com/jmoiron/sqlx.Select", Tag: "db", ArgPos: 1},