~samwhited/xmpp

204bc37aefdbb01aa23fa2af48e9f6bfd91474ae — Sam Whited 5 years ago 4b20aa3
Fix issues caught by go vet
4 files changed, 5 insertions(+), 6 deletions(-)

M config_test.go
M conn.go
M jid/benchmark_test.go
M message_test.go
M config_test.go => config_test.go +2 -2
@@ 12,7 12,7 @@ import (
func TestDefaultConnType(t *testing.T) {
	c := &Config{}
	if ct := c.connType(); ct != "xmpp-client" {
		t.Error("Wrong default value for conntype; expected xmpp-client but got %s", ct)
		t.Errorf("Wrong default value for conntype; expected xmpp-client but got %s", ct)
	}
}



@@ 20,6 20,6 @@ func TestDefaultConnType(t *testing.T) {
func TestS2SConnType(t *testing.T) {
	c := &Config{S2S: true}
	if ct := c.connType(); ct != "xmpp-server" {
		t.Error("Wrong s2s value for conntype; expected xmpp-server but got %s", ct)
		t.Errorf("Wrong s2s value for conntype; expected xmpp-server but got %s", ct)
	}
}

M conn.go => conn.go +0 -1
@@ 68,7 68,6 @@ type Conn struct {
func (c *Conn) connect(ctx context.Context) error {
	// TODO(ssw)
	panic("xmpp: connect not yet implemented")
	return nil
}

// Config returns the connections config.

M jid/benchmark_test.go => jid/benchmark_test.go +1 -1
@@ 55,6 55,6 @@ func BenchmarkBare(b *testing.B) {
func BenchmarkString(b *testing.B) {
	j := &JID{"user", "example.com", "resource"}
	for i := 0; i < b.N; i++ {
		j.String()
		_ = j.String()
	}
}

M message_test.go => message_test.go +2 -2
@@ 41,7 41,7 @@ func TestUnmarshalMessage(t *testing.T) {
			To:   &jid.JID{},
			From: &jid.JID{},
		},
		xml.Name{"", ""},
		xml.Name{},
	}
	err := xml.Unmarshal(mb, m)
	if err != nil {


@@ 72,7 72,7 @@ func TestMarshalMessage(t *testing.T) {
			To:   j,
			Lang: "en",
		},
		xml.Name{"jabber:client", "message"},
		xml.Name{Space: "jabber:client", Local: "message"},
	}
	// TODO: Check the output; is the order guaranteed?
	if _, err := xml.Marshal(m); err != nil {