Skip to content

Commit

Permalink
update package links
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane committed Oct 27, 2023
1 parent d059347 commit bfb45d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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
8 changes: 4 additions & 4 deletions builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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"},
Expand All @@ -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},
Expand Down

0 comments on commit bfb45d9

Please sign in to comment.