--- a/structs.go Wed Dec 28 13:28:45 2011 -0700
+++ b/structs.go Wed Dec 28 13:32:11 2011 -0700
@@ -21,8 +21,7 @@
// entities. It looks like node@domain/resource. Node and resource are
// sometimes optional.
type JID struct {
- // BUG(cjyar) Make this not a pointer.
- Node *string
+ Node string
Domain string
Resource string
}
@@ -156,8 +155,8 @@
func (jid *JID) String() string {
result := jid.Domain
- if jid.Node != nil {
- result = *jid.Node + "@" + result
+ if jid.Node != "" {
+ result = jid.Node + "@" + result
}
if jid.Resource != "" {
result = result + "/" + jid.Resource
@@ -171,11 +170,7 @@
if parts == nil {
return false
}
- if parts[2] == "" {
- jid.Node = nil
- } else {
- jid.Node = &parts[2]
- }
+ jid.Node = parts[2]
jid.Domain = parts[3]
jid.Resource = parts[5]
return true