X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=remote%2Fainsl%2Fainsl.go;h=2b5f8e0113700b0257768da1b6cf900808a174f5;hb=7181f7906e7fb6e73ebc0daa46975bfa9c71478f;hp=2a64d63439871954379b26630dabc763c1a73f44;hpb=2804606f9f8dc5078c38580bac363b47eb638620;p=safcm%2Fsafcm.git diff --git a/remote/ainsl/ainsl.go b/remote/ainsl/ainsl.go index 2a64d63..2b5f8e0 100644 --- a/remote/ainsl/ainsl.go +++ b/remote/ainsl/ainsl.go @@ -4,7 +4,7 @@ // // FAI: https://fai-project.org -// Copyright (C) 2021 Simon Ruderich +// Copyright (C) 2021-2024 Simon Ruderich // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ func Main(args []string) error { optionCreate := flag.Bool("create", false, "create the path if it does not exist") - flag.CommandLine.Parse(args[2:]) + flag.CommandLine.Parse(args[2:]) //nolint:errcheck if flag.NArg() != 2 { flag.Usage() @@ -119,7 +119,7 @@ func handle(path string, line string, create bool) ([]string, error) { gid = int(x.Gid) mode = stat.Mode() } - stat = nil // prevent accidental use + stat = nil //nolint:wastedassign // prevent accidental use // Check if the expected line is present var found bool @@ -161,7 +161,7 @@ func handle(path string, line string, create bool) ([]string, error) { } err = unix.Renameat(parentFd, tmpBase, parentFd, baseName) if err != nil { - unix.Unlinkat(parentFd, tmpBase, 0) + unix.Unlinkat(parentFd, tmpBase, 0 /* flags */) //nolint:errcheck return nil, err } err = unix.Fsync(parentFd)