go get created directories with exclamation points

454 views
Skip to first unread message

Dean Schulze

unread,
Jan 4, 2023, 11:30:28 AM1/4/23
to golang-nuts
I did go get to download some Azure SDK for Go modules.  This created directories with exclamation points in their names.  My code works from the command line, but Intellij won't recognize these modules.

Why does go get create directories with exclamation points in their names?


file.explorer.directories.with.exclamation.points.PNG

Marcin Romaszewicz

unread,
Jan 4, 2023, 11:57:56 AM1/4/23
to Dean Schulze, golang-nuts
Go converts uppercase characters to the corresponding lower case character with an exclamation point in front of it to avoid case sensitivity collisions on case insensitive filesystems. In my pkg/mod/github directory, DataDog is the worst offender since it has changed capitalization over time, so I have a "!d!a!t!a-!d!o!g" and a "!data!dog" directory, for example. It's working as intended. I don't use Intellij for Go, but I've had no problems with GoLand, also from JetBrains, since it knows how to handle those escaped capital letters.

-- Marcin

On Wed, Jan 4, 2023 at 8:30 AM Dean Schulze <dean.w....@gmail.com> wrote:
I did go get to download some Azure SDK for Go modules.  This created directories with exclamation points in their names.  My code works from the command line, but Intellij won't recognize these modules.

Why does go get create directories with exclamation points in their names?


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9bec22e0-2a18-4cb4-b1d8-6c1e9848a58en%40googlegroups.com.

Dean Schulze

unread,
Jan 4, 2023, 3:50:34 PM1/4/23
to golang-nuts
Thanks for that.

It turns out that Intellij's problem was that it doesn't enable Go module support when you create a new project from sources that include a go.mod file.  You have to enable Go module support manually.

I thought Intellij had fixed that bit of stupidity last year.
Reply all
Reply to author
Forward
0 new messages