* TOC level 3 * drop `.golangci.yaml` from the Configuration page * generate a dedicated configuration section for each linters. * fix changelog heading
		
			
				
	
	
		
			28 lines
		
	
	
		
			698 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			698 B
		
	
	
	
		
			Go
		
	
	
	
	
	
//args: -Egomodguard
 | 
						|
//config_path: testdata/configs/gomodguard.yml
 | 
						|
package testdata
 | 
						|
 | 
						|
import (
 | 
						|
	"log"
 | 
						|
 | 
						|
	"golang.org/x/mod/modfile"
 | 
						|
	"gopkg.in/yaml.v3" // ERROR "import of package `gopkg.in/yaml.v3` is blocked because the module is in the blocked modules list. `github.com/kylelemons/go-gypsy` is a recommended module. This is an example of recommendations."
 | 
						|
)
 | 
						|
 | 
						|
// Something just some struct
 | 
						|
type Something struct{}
 | 
						|
 | 
						|
func aAllowedImport() { // nolint: deadcode,unused
 | 
						|
	mfile, _ := modfile.Parse("go.mod", []byte{}, nil)
 | 
						|
 | 
						|
	log.Println(mfile)
 | 
						|
}
 | 
						|
 | 
						|
func aBlockedImport() { // nolint: deadcode,unused
 | 
						|
	data := []byte{}
 | 
						|
	something := Something{}
 | 
						|
	_ = yaml.Unmarshal(data, &something)
 | 
						|
 | 
						|
	log.Println(data)
 | 
						|
}
 |