瀏覽代碼

How about no? (#356)

I don't know why somebody would do something this inefficient, but I think plain concatination is a better approach
LEGOlord208 8 年之前
父節點
當前提交
9b9f289415
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      user.go

+ 1 - 5
user.go

@@ -1,9 +1,5 @@
 package discordgo
 
-import (
-	"fmt"
-)
-
 // A User stores all data for an individual Discord user.
 type User struct {
 	ID            string `json:"id"`
@@ -19,5 +15,5 @@ type User struct {
 
 //String returns a unique identifier of the form username#discriminator
 func (u *User) String() string {
-	return fmt.Sprintf("%s#%s", u.Username, u.Discriminator)
+	return u.Username + "#" + u.Discriminator
 }