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

gitignore for Go missing necessary files #646

Open
wathika-eng opened this issue Dec 7, 2024 · 0 comments
Open

gitignore for Go missing necessary files #646

wathika-eng opened this issue Dec 7, 2024 · 0 comments

Comments

@wathika-eng
Copy link

Issue Template

Frequently Asked Questions

Q: How do I submit a new .gitignore template?
A: Please submit all new templates to @toptal/gitignore.

Q: How do I suggest modifications to existing .gitignore templates?
A: Modifications should come in the form of pull requests at @toptal/gitignore.

Issue

Development Environment:

  • Machine: Ubuntu
  • Operating System: Ubuntu 24.10
  • Web Browser: Google Chrome
  • Go Version: 1.23

Expected Behavior:

The .gitignore template for Go projects should exclude common files and directories like:

  • .env files (which often contain sensitive environment variables)
  • ./main (commonly used binary output)
  • build/ (directory for compiled binaries)
  • tmp/ (temporary files)

Actual Behavior:

The default Go .gitignore template does not exclude the following:

  • .env
  • ./main
  • build/
  • tmp/

Reproduction Steps:

  1. Create a new Go project and initialize a Git repository:

    go mod init example.com/myapp  
    git init
  2. Go to https://www.toptal.com/developers/gitignore/ and request for a new .gitignore file for Go/Goland: https://www.toptal.com/developers/gitignore/api/go,goland

  3. Install air and initialize .air.toml file

  4. Add a .env file, test your app and build it for production.

image

Expected behaviour:
image

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

No branches or pull requests

1 participant