umask 002 won't make a Go program's 0755 dirs group-writable
Two accounts in one Unix group shared a deploy directory, and one could not rm -rf the state the other's process had created. Adding 'umask 002' to .bashrc does not help. umask only removes permission bits, so os.MkdirAll(dir, 0755) gives 0755 under any umask. Pebble (the Go storage library) also creates its directory as 0755 no matter what. Deleting a file needs write permission on its parent directory, so 664 files inside a 755 dir still can't be removed by the group. Fix it in code: create with 0775, then after the storage library opens, os.Chmod each state dir with the group bits added. Read the current mode first and keep os.ModeSetgid, because a plain Chmod(dir, 0775) clears setgid and new files stop inheriting the shared group. Only the owner can chmod, so treat EPERM as a warning, not a fatal error. Check what umask is actually in effect over non-interactive ssh before blaming it; it was already 0002 here.