Skip to content

feat: apply v1-based rewrite#15

Open
null8626 wants to merge 43 commits into
top-gg-community:masterfrom
null8626:v1/api
Open

feat: apply v1-based rewrite#15
null8626 wants to merge 43 commits into
top-gg-community:masterfrom
null8626:v1/api

Conversation

@null8626
Copy link
Copy Markdown
Member

@null8626 null8626 commented Mar 10, 2026

The following pull request is a fragment of a larger pull request.

It substitutes all v0 features with v1 ones. And since this change is obviously breaking, the pull request is a major update.

P.S: Due to dependency constraints, the SDK's minimum Go version is 1.25 now.

null8626 added 30 commits March 9, 2026 21:19
… StatusOK

Updated webhook response status to No Content for various events.
Copy link
Copy Markdown

@velddev velddev left a comment

Choose a reason for hiding this comment

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

Looks fine otherwise, just not sure if this is a standard you wanna keep following

Comment thread client.go
Do(*http.Request) (*http.Response, error)
}

// OptionFunc is a function that modifies the the *Client provided.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are standardized go comments if i recall correctly. You always start with the value you are documenting

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Noted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Also done for #16 here.

Copy link
Copy Markdown

@DevYukine DevYukine left a comment

Choose a reason for hiding this comment

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

lgtm

@kkrypt0nn
Copy link
Copy Markdown

kkrypt0nn commented Mar 10, 2026

❯ golangci-lint run
client.go:77:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
client.go:43:16: ST1005: error strings should not be capitalized (staticcheck)
			return nil, errors.New("Specified dbl.Client option func must not be null")
			            ^
client.go:45:16: ST1005: error strings should not be capitalized (staticcheck)
			return nil, fmt.Errorf("Unable to run dbl.Client option func: %w", err)
			            ^
client.go:67:11: ST1005: error strings should not be capitalized (staticcheck)
			return errors.New("Unable to type assert Client.httpClient to *http.Client")
			       ^
client.go:81:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Attempted to send an invalid request to the API.")
		            ^
client.go:83:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Invalid Top.gg API token.")
		            ^
client.go:85:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Such query does not exist.")

It's worth moving away from Travis, which has been paid for some years now, to GitHub Actions and add golangci/golangci-lint-action to the workflow

@null8626
Copy link
Copy Markdown
Member Author

❯ golangci-lint run
client.go:77:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
client.go:43:16: ST1005: error strings should not be capitalized (staticcheck)
			return nil, errors.New("Specified dbl.Client option func must not be null")
			            ^
client.go:45:16: ST1005: error strings should not be capitalized (staticcheck)
			return nil, fmt.Errorf("Unable to run dbl.Client option func: %w", err)
			            ^
client.go:67:11: ST1005: error strings should not be capitalized (staticcheck)
			return errors.New("Unable to type assert Client.httpClient to *http.Client")
			       ^
client.go:81:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Attempted to send an invalid request to the API.")
		            ^
client.go:83:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Invalid Top.gg API token.")
		            ^
client.go:85:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
		return nil, errors.New("Such query does not exist.")

It's worth moving away from Travis, which has been paid for some years now, to GitHub Actions and add golangci/golangci-lint-action to the workflow

Thank you so much for your feedback @kkrypt0nn! ❤️ I didn't touch the project's Travis configuration that much because I have never used Travis before and I didn't want to mess with something I am super not familiar with! I will surely take a look at it!

null8626 added a commit to null8626/go-sdk that referenced this pull request Mar 10, 2026
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.

4 participants