@@ -340,7 +340,7 @@ func ensureSupportedVersion() error {
340340func getAPI () (uint , error ) {
341341 api := C .seccomp_api_get ()
342342 if api == 0 {
343- return 0 , fmt . Errorf ("API level operations are not supported" )
343+ return 0 , errors . New ("API level operations are not supported" )
344344 }
345345
346346 return uint (api ), nil
@@ -351,7 +351,7 @@ func setAPI(api uint) error {
351351 if retCode := C .seccomp_api_set (C .uint (api )); retCode != 0 {
352352 e := errRc (retCode )
353353 if e == syscall .EOPNOTSUPP {
354- return fmt . Errorf ("API level operations are not supported" )
354+ return errors . New ("API level operations are not supported" )
355355 }
356356
357357 return fmt .Errorf ("could not set API level: %w" , e )
@@ -412,7 +412,7 @@ func (f *ScmpFilter) setFilterAttr(attr scmpFilterAttr, value C.uint32_t) error
412412// Wrapper for seccomp_rule_add_... functions
413413func (f * ScmpFilter ) addRuleWrapper (call ScmpSyscall , action ScmpAction , exact bool , length C.uint , cond C.scmp_cast_t ) error {
414414 if length != 0 && cond == nil {
415- return fmt . Errorf ("null conditions list, but length is nonzero" )
415+ return errors . New ("null conditions list, but length is nonzero" )
416416 }
417417
418418 var retCode C.int
@@ -431,7 +431,7 @@ func (f *ScmpFilter) addRuleWrapper(call ScmpSyscall, action ScmpAction, exact b
431431 case syscall .EPERM , syscall .EACCES :
432432 return errDefAction
433433 case syscall .EINVAL :
434- return fmt . Errorf ("two checks on same syscall argument" )
434+ return errors . New ("two checks on same syscall argument" )
435435 default :
436436 return e
437437 }
@@ -456,7 +456,7 @@ func (f *ScmpFilter) addRuleGeneric(call ScmpSyscall, action ScmpAction, exact b
456456 } else {
457457 argsArr := C .make_arg_cmp_array (C .uint (len (conds )))
458458 if argsArr == nil {
459- return fmt . Errorf ("error allocating memory for conditions" )
459+ return errors . New ("error allocating memory for conditions" )
460460 }
461461 defer C .free (argsArr )
462462
@@ -496,7 +496,7 @@ func sanitizeAction(in ScmpAction) error {
496496 }
497497
498498 if inTmp != ActTrace && inTmp != ActErrno && (in & 0xFFFF0000 ) != 0 {
499- return fmt . Errorf ("highest 16 bits must be zeroed except for Trace and Errno" )
499+ return errors . New ("highest 16 bits must be zeroed except for Trace and Errno" )
500500 }
501501
502502 return nil
0 commit comments