Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/go tests #3

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Feat/go tests #3

merged 4 commits into from
Dec 17, 2024

Conversation

kek-Sec
Copy link
Owner

@kek-Sec kek-Sec commented Dec 17, 2024

This pull request introduces several changes to the codebase, mainly focusing on adding new dependencies, improving configuration and database handling, and enhancing the test coverage. Here are the most important changes:

Dependencies

  • Added new dependencies github.com/gin-contrib/cors, github.com/stretchr/testify, github.com/davecgh/go-spew, github.com/kr/text, and github.com/pmezard/go-difflib to the go.mod file. [1] [2]

Configuration

  • Added new tests in internal/config/config_test.go to verify default configuration values, environment variable overrides, and handling of invalid MAX_FILE_SIZE values.

Database

  • Introduced tests in internal/database/database_test.go for InitDB and CleanupExpired functions to ensure proper database initialization and cleanup of expired records.

Routes

  • Added tests in internal/routes/routes_test.go to verify the existence of routes and proper CORS headers handling.

Security

  • Improved the GenerateHash function in internal/security/hash.go to handle negative length inputs by returning an error.
  • Added tests in internal/security/hash_test.go to validate the GenerateHash function with various input lengths and ensure uniqueness of generated hashes.

@kek-Sec kek-Sec merged commit 9ef3254 into main Dec 17, 2024
4 checks passed
@kek-Sec kek-Sec deleted the feat/go-tests branch December 17, 2024 19:02
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.

1 participant