Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for lookupStaticAddr (0.14 sec)

  1. src/net/hosts_test.go

    		}
    	}
    }
    
    func testStaticAddr(t *testing.T, hostsPath string, ent staticHostEntry) {
    	hosts := lookupStaticAddr(ent.in)
    	for i := range ent.out {
    		ent.out[i] = absDomainName(ent.out[i])
    	}
    	if !reflect.DeepEqual(hosts, ent.out) {
    		t.Errorf("%s, lookupStaticAddr(%s) = %v; want %v", hostsPath, ent.in, hosts, ent.out)
    	}
    }
    
    func TestHostCacheModification(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 04 07:21:38 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  2. src/net/hosts.go

    			ipsCp := make([]string, len(byName.addrs))
    			copy(ipsCp, byName.addrs)
    			return ipsCp, byName.canonicalName
    		}
    	}
    	return nil, ""
    }
    
    // lookupStaticAddr looks up the hosts for the given address from /etc/hosts.
    func lookupStaticAddr(addr string) []string {
    	hosts.Lock()
    	defer hosts.Unlock()
    	readHosts()
    	addr = parseLiteralIP(addr)
    	if addr == "" {
    		return nil
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 04 07:21:38 UTC 2023
    - 3.5K bytes
    - Viewed (0)
Back to top