Skip to content

Commit

Permalink
docs: Replace links to godoc.org with pkg.go.dev (#3584)
Browse files Browse the repository at this point in the history
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
alexandear and ldez committed Feb 11, 2023
1 parent e128f0d commit a221d01
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions docs/src/docs/contributing/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l
```

First, we find a load mode as union of load modes for all enabled linters.
We use [go/packages](https://godoc.org/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes.
We use [go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes.
Load mode sets which data does a linter needs for execution.

A linter that works only with AST need minimum of information: only filenames and AST. There is no need for
Expand Down Expand Up @@ -165,7 +165,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithLoadForGoAnalysis().
WithPresets(linter.PresetBugs).
WithAlternativeNames("vet", "vetshadow").
WithURL("https://golang.org/cmd/vet/"),
WithURL("https://pkg.go.dev/cmd/vet"),
linter.NewConfig(golinters.NewBodyclose()).
WithLoadForGoAnalysis().
WithPresets(linter.PresetPerformance, linter.PresetBugs).
Expand Down Expand Up @@ -208,10 +208,10 @@ Currently, all linters except `unused` can be merged into this meta linter.
The `unused` isn't merged because it has high memory usage.

Linters execution starts in `runAnalyzers`. It's the most complex part of the `golangci-lint`.
We use custom [go/analysis](https://godoc.org/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can
We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can
to reduce memory usage. Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory.

We don't use existing [multichecker](https://godoc.org/golang.org/x/tools/go/analysis/multichecker) because
We don't use existing [multichecker](https://pkg.go.dev/golang.org/x/tools/go/analysis/multichecker) because
it doesn't use caching and doesn't have some important performance optimizations.

All found by linters issues are represented with `result.Issue` struct:
Expand Down
4 changes: 2 additions & 2 deletions docs/src/docs/contributing/workflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ conduct](https://github.com/golangci/golangci-lint/blob/master/CODE_OF_CONDUCT.m

## Setup your machine

`golangci-lint` is written in [Go](https://golang.org/).
`golangci-lint` is written in [Go](https://go.dev).

Prerequisites:

- `make`
- [Go](https://golang.org/doc/install)
- [Go](https://go.dev/doc/install)

Fork and clone [golangci-lint](https://github.com/golangci/golangci-lint) repository.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/usage/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ the `go tool trace` command and visualization tool.

## Cache

GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://golang.org/pkg/os/#UserCacheDir).
GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://pkg.go.dev/os#UserCacheDir).

You can override the default cache directory with the environment variable `GOLANGCI_LINT_CACHE`; the path must be absolute.
2 changes: 1 addition & 1 deletion docs/src/docs/usage/performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Performance

## Memory Usage

A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://golang.org/pkg/runtime/#hdr-Environment_Variables) environment variable.
A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://pkg.go.dev/runtime#hdr-Environment_Variables) environment variable.
Less `GOGC` values trigger garbage collection more frequently and golangci-lint consumes less memory and more CPU. Below is the trade-off table for running on this repo:

| `GOGC` | Peak Memory, GB | Execution Time, s |
Expand Down
6 changes: 3 additions & 3 deletions pkg/lint/lintersdb/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithSince("v1.0.0").
WithPresets(linter.PresetFormatting).
WithAutoFix().
WithURL("https://golang.org/cmd/gofmt/"),
WithURL("https://pkg.go.dev/cmd/gofmt"),

linter.NewConfig(golinters.NewGofumpt(gofumptCfg)).
WithSince("v1.28.0").
Expand All @@ -514,7 +514,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithSince("v1.20.0").
WithPresets(linter.PresetFormatting, linter.PresetImport).
WithAutoFix().
WithURL("https://godoc.org/golang.org/x/tools/cmd/goimports"),
WithURL("https://pkg.go.dev/golang.org/x/tools/cmd/goimports"),

linter.NewConfig(golinters.NewGolint(golintCfg)).
WithSince("v1.0.0").
Expand Down Expand Up @@ -562,7 +562,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithLoadForGoAnalysis().
WithPresets(linter.PresetBugs, linter.PresetMetaLinter).
WithAlternativeNames("vet", "vetshadow").
WithURL("https://golang.org/cmd/vet/"),
WithURL("https://pkg.go.dev/cmd/vet"),

linter.NewConfig(golinters.NewGrouper(grouperCfg)).
WithSince("v1.44.0").
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/processors/autogenerated_exclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (p *AutogeneratedExclude) shouldPassIssue(i *result.Issue) (bool, error) {
}

// isGenerated reports whether the source file is generated code.
// Using a bit laxer rules than https://golang.org/s/generatedcode to
// Using a bit laxer rules than https://go.dev/s/generatedcode to
// match more generated code. See #48 and #72.
func isGeneratedFileByComment(doc string) bool {
const (
Expand Down

0 comments on commit a221d01

Please sign in to comment.