podman/pkg/specgen
Paul Holzinger 51fbf3da9e
enable gocritic linter
The linter ensures a common code style.
- use switch/case instead of else if
- use if instead of switch/case for single case statement
- add space between comment and text
- detect the use of defer with os.Exit()
- use short form var += "..." instead of var = var + "..."
- detect problems with append()
```
newSlice := append(orgSlice, val)
```
  This could lead to nasty bugs because the orgSlice will be changed in
  place if it has enough capacity too hold the new elements. Thus we
  newSlice might not be a copy.

Of course most of the changes are just cosmetic and do not cause any
logic errors but I think it is a good idea to enforce a common style.
This should help maintainability.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-26 18:12:22 +02:00
..
generate enable gocritic linter 2022-04-26 18:12:22 +02:00
config_unsupported.go go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
container_validate.go enable gocritic linter 2022-04-26 18:12:22 +02:00
namespaces.go Merge pull request #13973 from Luap99/linter-revive 2022-04-23 06:32:41 -04:00
namespaces_test.go bump go module to version 4 2022-01-18 12:47:07 +01:00
pod_validate.go bump go module to version 4 2022-01-18 12:47:07 +01:00
podspecgen.go Merge pull request #12930 from cdoern/podCgroup 2022-02-04 09:41:12 -05:00
specgen.go run, create: add --passwd-entry 2022-04-14 11:22:13 +02:00
specgen_test.go fix test 2021-10-11 17:41:58 +08:00
volumes.go Implements Windows volume/mount support 2022-04-25 13:52:27 -05:00
winpath.go enable gocritic linter 2022-04-26 18:12:22 +02:00
winpath_linux.go Implements Windows volume/mount support 2022-04-25 13:52:27 -05:00
winpath_unsupported.go Implements Windows volume/mount support 2022-04-25 13:52:27 -05:00
winpath_windows.go Implements Windows volume/mount support 2022-04-25 13:52:27 -05:00