Skip to content

Feat/first build#1

Open
reecebedding wants to merge 7 commits intomainfrom
feat/first-build
Open

Feat/first build#1
reecebedding wants to merge 7 commits intomainfrom
feat/first-build

Conversation

@reecebedding
Copy link
Collaborator

No description provided.

Comment on lines 78 to 82
if base == "" {
client.BaseURL = baseUrl
} else {
client.BaseURL = base
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not wrong, but the idiomatic way to do this in go would be:

Suggested change
if base == "" {
client.BaseURL = baseUrl
} else {
client.BaseURL = base
}
if base == "" {
base = baseUrl
}
client.BaseURL = base

saves us this else statement

Comment on lines +78 to +82
if base == "" {
base = baseUrl
}
client.BaseURL = base
return client, nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol just realized this could be even simpler (because of the way the Client is initialized on lines 73-76)

Suggested change
if base == "" {
base = baseUrl
}
client.BaseURL = base
return client, nil
if base != "" {
client.BaseUrl = base
}
return client, nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants