Merge PR #1281: Don't run defers if it would result in an NPE
* Don't run defers if it would result in an NPE * Nuke CircleCI caches
This commit is contained in:
committed by
Christopher Goes
parent
364bb0813f
commit
1f88b0bf8f
@@ -18,6 +18,7 @@ import (
|
||||
|
||||
func TestStartStandAlone(t *testing.T) {
|
||||
home, err := ioutil.TempDir("", "mock-sdk-cmd")
|
||||
require.Nil(t, err)
|
||||
defer func() {
|
||||
os.RemoveAll(home)
|
||||
}()
|
||||
|
||||
@@ -18,10 +18,10 @@ import (
|
||||
// protocol is either tcp, http, etc
|
||||
func FreeTCPAddr() (addr, port string, err error) {
|
||||
l, err := net.Listen("tcp", "0.0.0.0:0")
|
||||
defer l.Close()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
defer l.Close()
|
||||
|
||||
portI := l.Addr().(*net.TCPAddr).Port
|
||||
port = fmt.Sprintf("%d", portI)
|
||||
|
||||
Reference in New Issue
Block a user