libnetwork/internal/resolvconf/resolvconf.go
Method ResolvConf.Generate
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (rc *ResolvConf) Generate(comments bool) ([]byte, error) {
s := struct {
Md *metadata
NameServers []netip.Addr
Search []string
Function UserModified
has 6 return statements (exceeds 4 allowed). Open
Open
func UserModified(rcPath, rcHashPath string) (bool, error) {
currRCHash, err := os.ReadFile(rcHashPath)
if err != nil {
// If the hash file doesn't exist, can only assume it hasn't been written
// yet (so, the user hasn't modified the file it hashes).
Method ResolvConf.WriteFile
has 5 return statements (exceeds 4 allowed). Open
Open
func (rc *ResolvConf) WriteFile(path, hashPath string, perm os.FileMode) error {
content, err := rc.Generate(true)
if err != nil {
return err
}