aboutsummaryrefslogtreecommitdiff
path: root/pkg/origin/origin.go
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-14 15:12:06 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-14 15:12:06 -0400
commit38218809c7ce18d43c73f21be60bad93e8186f4e (patch)
treecfb5eda662cd1d8b004d5f3836d2a09a47bcadc1 /pkg/origin/origin.go
parent529e7d2f30b7457d069d00cefdb9a36aa1c5fd71 (diff)
downloadAtlas-38218809c7ce18d43c73f21be60bad93e8186f4e.tar.gz
Atlas-38218809c7ce18d43c73f21be60bad93e8186f4e.zip
pkg/origin: Use uint64 for uids
Diffstat (limited to 'pkg/origin/origin.go')
-rw-r--r--pkg/origin/origin.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/origin/origin.go b/pkg/origin/origin.go
index 7f7abb7..d7f4426 100644
--- a/pkg/origin/origin.go
+++ b/pkg/origin/origin.go
@@ -25,7 +25,7 @@ var Base = "https://api1.origin.com"
// UserInfo contains information about an Origin account.
type UserInfo struct {
- UserID int
+ UserID uint64
PersonaID string
EAID string
}
@@ -33,10 +33,10 @@ type UserInfo struct {
// GetUserInfo gets information about Origin accounts by their Origin UserID.
//
// If errors.Is(err, ErrAuthRequired), you need a new NucleusToken.
-func GetUserInfo(ctx context.Context, token NucleusToken, uid ...int) ([]UserInfo, error) {
+func GetUserInfo(ctx context.Context, token NucleusToken, uid ...uint64) ([]UserInfo, error) {
uids := make([]string, len(uid))
for _, x := range uid {
- uids = append(uids, strconv.Itoa(x))
+ uids = append(uids, strconv.FormatUint(x, 10))
}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, Base+"/atom/users?userIds="+strings.Join(uids, ","), nil)
@@ -118,7 +118,7 @@ func parseUserInfo(buf []byte, root xml.Name) ([]UserInfo, error) {
res := make([]UserInfo, len(obj.User))
for i, x := range obj.User {
var v UserInfo
- if uid, err := strconv.Atoi(x.UserID); err == nil {
+ if uid, err := strconv.ParseUint(x.UserID, 10, 64); err == nil {
v.UserID = uid
} else {
return nil, fmt.Errorf("parse userId %q: %w", x.UserID, err)