github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbnm/hostmanifest/whitelist_nix.go (about)

     1  //go:build !darwin
     2  // +build !darwin
     3  
     4  package hostmanifest
     5  
     6  import (
     7  	"fmt"
     8  	"os"
     9  	"path/filepath"
    10  )
    11  
    12  func wrapWriteErr(err error, hostsPath string) error {
    13  	if !os.IsPermission(err) {
    14  		return err
    15  	}
    16  	dirName := filepath.Dir(hostsPath)
    17  	return fmt.Errorf("%s: Make sure you have write permissions on the directory: %q", err, dirName)
    18  }