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

Give Go module initialized with dispatch init the same name as it's directory name #81

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

chicoxyzzy
Copy link
Contributor

@chicoxyzzy chicoxyzzy commented Jul 4, 2024

This code patches the first line of the go.mod file to set a module name to a directory name.

Copy link
Contributor

@achille-roussel achille-roussel left a comment

Choose a reason for hiding this comment

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

Nice improvement 👍

return err
}

// TODO: create .gitignore file?
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a .gitignore file to the template so we don't need this to be a special case?

Copy link
Contributor Author

@chicoxyzzy chicoxyzzy Jul 4, 2024

Choose a reason for hiding this comment

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

I initially added it, but we never know what will be the -o flag value to ignore the binary. I made it equal to the directory name as well initially (when -o is omitted), but that's also dynamical.

What known in advance Go directories and files I should exclude?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's roll with these 👍

@chicoxyzzy
Copy link
Contributor Author

Merging this. See #82 for .gitignore

@chicoxyzzy chicoxyzzy merged commit e4280a0 into main Jul 4, 2024
3 checks passed
@chicoxyzzy chicoxyzzy deleted the modify_go_template branch July 4, 2024 17:51
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