-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add GoLand configuration in hacking on gitea #16843
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,6 +309,19 @@ Visual Studio Code. Look at | |
[`contrib/ide/README.md`](https://github.com/go-gitea/gitea/blob/main/contrib/ide/README.md) | ||
for more information. | ||
|
||
## GoLand | ||
|
||
Clicking the `Run Application` arrow on the function `func main()` in `/main.go` | ||
can quickly start a debuggable gitea instance. | ||
|
||
The `Output Directory` in `Run/Debug Configuration` MUST be set to the | ||
gitea project directory (which contains `main.go` and `go.mod`), | ||
otherwise, the started instance's working directory is a GoLand's temporary directory | ||
and prevents gitea from loading dynamic resources (eg: templates) in a development environment. | ||
|
||
To run unit tests with SQLite in GoLand, set `-tags sqlite,sqlite_unlock_notify` | ||
in `Go tool arguments` of `Run/Debug Configuration`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could GoLand be made to just call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In vscode I also have to add these tags. The main benefit is that you can just get editor to run the test individually without having to run through the entire source code tree looking for the matching test name. It's much much faster There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add that if you're debugging or otherwise running code you will need to set the appropriate build tags anyway. For example if you're debugging gogit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm yeah I guess i agree. Maybe we should at least reference that these default tags come from the Makefile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @silverwind Yes, GoLand can call |
||
|
||
## Submitting PRs | ||
|
||
Once you're happy with your changes, push them up and open a pull request. It | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah if that's the only problem then you could consider setting one of the custom_dir or other environment variables. But this sounds easier overall.