소스 검색

STOP USING PRINTF PLS

LEGOlord208 7 년 전
부모
커밋
c40b975354
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      user.go

+ 2 - 4
user.go

@@ -1,7 +1,5 @@
 package discordgo
 
-import "fmt"
-
 // A User stores all data for an individual Discord user.
 type User struct {
 	ID            string `json:"id"`
@@ -17,10 +15,10 @@ 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
 }
 
 // Mention return a string which mentions the user
 func (u *User) Mention() string {
-	return fmt.Sprintf("<@%s>", u.ID)
+	return "<@" + u.ID + ">"
 }