mirror of
https://github.com/jesperh1/csgo-hub-discord.git
synced 2025-06-07 20:08:46 +01:00
Remove legacy code
This commit is contained in:
parent
ec5e550fa8
commit
f5aa6e432d
18
main.go
18
main.go
@ -165,24 +165,6 @@ type userStruct struct {
|
|||||||
FriendCode string `json:"friend_code"`
|
FriendCode string `json:"friend_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetFriendCode(users []string) []userStruct {
|
|
||||||
var userArr []userStruct
|
|
||||||
for _, u := range users {
|
|
||||||
resp, err := http.Get("http://localhost:8383/api/v1/user/" + u)
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
log.Println("quiting")
|
|
||||||
return userArr
|
|
||||||
}
|
|
||||||
var userTemp userStruct
|
|
||||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
|
||||||
resp.Body.Close()
|
|
||||||
json.Unmarshal(bodyBytes, &userTemp)
|
|
||||||
userArr = append(userArr, userTemp)
|
|
||||||
}
|
|
||||||
return userArr
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetFriendCodes(users []string) []userStruct {
|
func GetFriendCodes(users []string) []userStruct {
|
||||||
var userArr []userStruct
|
var userArr []userStruct
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user