mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-02 15:37:11 +00:00
Prefer nil empty slices
Signed-off-by: David Gageot <david.gageot@docker.com>
This commit is contained in:
@@ -80,7 +80,7 @@ func mkdir(path string, perm os.FileMode) {
|
||||
|
||||
// list of all enabled cgroups
|
||||
func cgroupList() []string {
|
||||
list := []string{}
|
||||
var list []string
|
||||
f, err := os.Open("/proc/cgroups")
|
||||
if err != nil {
|
||||
log.Printf("cannot open /proc/cgroups: %v", err)
|
||||
@@ -125,7 +125,7 @@ func read(path string) string {
|
||||
|
||||
// read a directory
|
||||
func readdir(path string) []string {
|
||||
names := []string{}
|
||||
var names []string
|
||||
files, err := os.ReadDir(path)
|
||||
if err != nil {
|
||||
log.Printf("cannot read directory %s: %v", path, err)
|
||||
|
@@ -85,7 +85,7 @@ func systemInitCmd(ctx context.Context, args []string) {
|
||||
_ = os.Remove(*sock)
|
||||
|
||||
// look for containerd options
|
||||
ctrdArgs := []string{}
|
||||
var ctrdArgs []string
|
||||
var (
|
||||
stderr io.Writer = os.Stderr
|
||||
stdout io.Writer = os.Stdout
|
||||
|
Reference in New Issue
Block a user