mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-28 08:13:11 +00:00
types/empty: add Message, stop using mysterious *struct{}
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
4796f6fd67
commit
747c7d7ce2
@@ -21,6 +21,7 @@ import (
|
||||
"tailscale.com/logger"
|
||||
"tailscale.com/logtail/backoff"
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/types/empty"
|
||||
)
|
||||
|
||||
// TODO(apenwarr): eliminate the 'state' variable, as it's now obsolete.
|
||||
@@ -60,7 +61,7 @@ func (s state) String() string {
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
LoginFinished *struct{}
|
||||
LoginFinished *empty.Message
|
||||
Err string
|
||||
URL string
|
||||
Persist *Persist // locally persisted configuration
|
||||
@@ -507,9 +508,9 @@ func (c *Client) sendStatus(who string, err error, url string, nm *NetworkMap) {
|
||||
c.logf("sendStatus: %s: %v\n", who, state)
|
||||
|
||||
var p *Persist
|
||||
var fin *struct{}
|
||||
var fin *empty.Message
|
||||
if state == stateAuthenticated {
|
||||
fin = &struct{}{}
|
||||
fin = new(empty.Message)
|
||||
}
|
||||
if nm != nil && loggedIn && synced {
|
||||
pp := c.direct.GetPersist()
|
||||
|
||||
@@ -7,6 +7,8 @@ package controlclient
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"tailscale.com/types/empty"
|
||||
)
|
||||
|
||||
func fieldsOf(t reflect.Type) (fields []string) {
|
||||
@@ -55,7 +57,7 @@ func TestStatusEqual(t *testing.T) {
|
||||
},
|
||||
{
|
||||
&Status{LoginFinished: nil},
|
||||
&Status{LoginFinished: new(struct{})},
|
||||
&Status{LoginFinished: new(empty.Message)},
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user