mirror of https://github.com/status-im/consul.git
Adds a Bool helper function.
This commit is contained in:
parent
e80d1a58fb
commit
d61661a98f
|
@ -430,6 +430,11 @@ type Config struct {
|
||||||
Reap *bool `mapstructure:"reap"`
|
Reap *bool `mapstructure:"reap"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bool is used to initialize bool pointers in struct literals.
|
||||||
|
func Bool(b bool) *bool {
|
||||||
|
return &b
|
||||||
|
}
|
||||||
|
|
||||||
// UnixSocketPermissions contains information about a unix socket, and
|
// UnixSocketPermissions contains information about a unix socket, and
|
||||||
// implements the FilePermissions interface.
|
// implements the FilePermissions interface.
|
||||||
type UnixSocketPermissions struct {
|
type UnixSocketPermissions struct {
|
||||||
|
|
|
@ -1287,9 +1287,8 @@ func TestMergeConfig(t *testing.T) {
|
||||||
RPC: &net.TCPAddr{},
|
RPC: &net.TCPAddr{},
|
||||||
RPCRaw: "127.0.0.5:1233",
|
RPCRaw: "127.0.0.5:1233",
|
||||||
},
|
},
|
||||||
Reap: new(bool),
|
Reap: Bool(true),
|
||||||
}
|
}
|
||||||
*b.Reap = true
|
|
||||||
|
|
||||||
c := MergeConfig(a, b)
|
c := MergeConfig(a, b)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue