Made App Engine runtime compatible.
This commit is contained in:
parent
24a92fd581
commit
47c887338f
3 changed files with 38 additions and 1 deletions
|
@ -77,7 +77,7 @@ func NewTLSCertPair(organization string, validUntil time.Time, extraHosts []stri
|
||||||
"localhost": true,
|
"localhost": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
addrs, err := net.InterfaceAddrs()
|
addrs, err := interfaceAddrs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
18
net.go
Normal file
18
net.go
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
// Copyright (c) 2013-2014 Conformal Systems LLC.
|
||||||
|
// Use of this source code is governed by an ISC
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build !appengine
|
||||||
|
|
||||||
|
package btcutil
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
// interfaceAddrs returns a list of the system's network interface addresses.
|
||||||
|
// It is wrapped here so that we can substitute it for other functions when
|
||||||
|
// building for systems that do not allow access to net.InterfaceAddrs().
|
||||||
|
func interfaceAddrs() ([]net.Addr, error) {
|
||||||
|
return net.InterfaceAddrs()
|
||||||
|
}
|
19
net_noop.go
Normal file
19
net_noop.go
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (c) 2013-2014 Conformal Systems LLC.
|
||||||
|
// Use of this source code is governed by an ISC
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
|
package btcutil
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
// interfaceAddrs returns a list of the system's network interface addresses.
|
||||||
|
// It is wrapped here so that we can substitute it for a no-op function that
|
||||||
|
// returns an empty slice of net.Addr when building for systems that do not
|
||||||
|
// allow access to net.InterfaceAddrs().
|
||||||
|
func interfaceAddrs() ([]net.Addr, error) {
|
||||||
|
return []net.Addr{}, nil
|
||||||
|
}
|
Loading…
Reference in a new issue