I recently moved over to IntelliJ, from VSCode, after a few recommendations. I've had the normal issues one gets with a new IDE (key-mappings etc), but there's a couple I just can't figure out.
Problem 1. (Go Tests)
Say I have the following project structure in
I can't run a test in
db_test.go (by pressing the green play button), without getting an undefined error because it can't see the function in
I've figured out that I can go in and change the Configurations to run the directory, but I still can't use the green play button because it creates a new configuration.
Is there not a default somewhere I can set to have every Go test run as "directory" so I don't need to add a brand new configuration for every test I want to run, and then have to screw around when I want to run one individual test.
This just "works" in VSCode, so I'm hoping it's an easy thing that I've overlooked for IntelliJ.
Problem 2. (Random formatting)
I have setup gofmt, on save, for my Go code. However I am also getting weird formatting behaviour when I'm in the middle of writing my code, for example:
- While I'm making a new function, if I add parenthesis and don't add anything in them straight away - they get deleted.
- If I add a space and don't immediately start typing - it gets deleted.
Is there a setting somewhere to stop all this formatting, because it's very annoying.