You've already forked dcmerge
fix(golangci): add config
All checks were successful
Run Golang tests / Run unit tests (stable, ubuntu-latest-amd64) (push) Successful in 6s
Lint Markdown files / Run markdown linter (push) Successful in 3s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-arm64) (push) Successful in 29s
Run Golang tests / Run unit tests (stable, ubuntu-latest-arm64) (push) Successful in 23s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-amd64) (push) Successful in 59s
All checks were successful
Run Golang tests / Run unit tests (stable, ubuntu-latest-amd64) (push) Successful in 6s
Lint Markdown files / Run markdown linter (push) Successful in 3s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-arm64) (push) Successful in 29s
Run Golang tests / Run unit tests (stable, ubuntu-latest-arm64) (push) Successful in 23s
Lint Golang files / Run golang CI linter (stable, ubuntu-latest-amd64) (push) Successful in 59s
This commit is contained in:
13
.golangci.yaml
Normal file
13
.golangci.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
version: "2"
|
||||
linters:
|
||||
default: standard
|
||||
enable:
|
||||
- errname
|
||||
- gosec
|
||||
|
||||
exclusions:
|
||||
rules: []
|
||||
warn-unused: true
|
||||
|
||||
run:
|
||||
tests: true
|
@ -90,11 +90,13 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
|
||||
switch {
|
||||
case len(outputFile) > 0:
|
||||
// #nosec G301
|
||||
err = os.MkdirAll(filepath.Dir(outputFile), 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// #nosec G304
|
||||
f, err := os.Create(outputFile)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -43,7 +43,7 @@ func Fetch(urls ...string) ([]*dockerCompose.Config, error) {
|
||||
return dockerComposeConfigs, nil
|
||||
}
|
||||
|
||||
var ErrorPathIsDir error = errors.New("path is a directory")
|
||||
var ErrPathIsDir error = errors.New("path is a directory")
|
||||
|
||||
func getDockerComposeViaHTTP(url string) (*dockerCompose.Config, error) {
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
@ -78,9 +78,10 @@ func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
|
||||
case err != nil:
|
||||
return nil, err
|
||||
case fileStat.IsDir():
|
||||
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)
|
||||
return nil, fmt.Errorf("%w: %s", ErrPathIsDir, name)
|
||||
}
|
||||
|
||||
// #nosec G304
|
||||
file, err := os.Open(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user