4 ms·
Hmm i made a golang project to test https://git.sr.ht/~ata/demo/tree/master/main.go https://git.sr.ht/~ata/demo/tree/master/main.go and first thing I noticed wa
by andrewfromx 8y ago
Hmm i made a golang project to test https://git.sr.ht/~ata/demo/tree/master/main.go https://git.sr.ht/~ata/demo/tree/master/main.go and first thing I noticed was that ~ in my package name. I wonder if that’s valid golang?
- andrewfromx 8y agoGolang doesn’t have a problem with it, but I would have to rename src/git.sr.ht/ata src/git.sr.ht/~ata a ~ in the filename which linux doesn’t like
- andrewfromx 8y agoI mean, you can do it, it’ll work but looks weird.
- aaronmdjones 8y agoThe only characters not allowed in a filename on Linux are 0x00 (the null byte) and '/'. It's perfectly valid to have '~' in it. You may be confused because your shell expands it to the value of $HOME -- which you can prevent by putting it inside single quotes. aaron@aspire5742:~$ echo hi > 'foo~bar.txt' aaron@aspire5742:~$ ls -l *.txt -rw-r--r-- 1 aaron aaron 3 Nov 16 03:20 foo~bar.txt aaron@aspire5742:~$ cat 'foo~bar.txt' hi aaron@aspire5742:~$