Fix tests and linters

This commit is contained in:
Daniel
2022-02-02 12:48:42 +01:00
parent f2fcad4d11
commit 60d8664e7b
171 changed files with 944 additions and 874 deletions

View File

@@ -48,7 +48,7 @@ func EnsureChromeSandboxPermissions(reg *updater.ResourceRegistry) error {
filepath.Ext(pmElectronUpdate.Path()),
)
sandboxFile := filepath.Join(unpackedPath, "chrome-sandbox")
if err := os.Chmod(sandboxFile, 0755|os.ModeSetuid); err != nil {
if err := os.Chmod(sandboxFile, 0o0755|os.ModeSetuid); err != nil {
return err
}
log.Infof("updates: fixed SUID permission for chrome-sandbox")
@@ -56,7 +56,7 @@ func EnsureChromeSandboxPermissions(reg *updater.ResourceRegistry) error {
return nil
}
func checkSysctl(setting string, value byte) bool {
func checkSysctl(setting string, value byte) bool { //nolint:deadcode,unused // TODO: Do we still need this?
c, err := sysctl(setting)
if err != nil {
return false
@@ -67,7 +67,7 @@ func checkSysctl(setting string, value byte) bool {
return c[0] == value
}
func sysctl(setting string) ([]byte, error) {
func sysctl(setting string) ([]byte, error) { //nolint:unused // TODO: Do we still need this?
parts := append([]string{"/proc", "sys"}, strings.Split(setting, ".")...)
path := filepath.Join(parts...)
content, err := ioutil.ReadFile(path)