aboutsummaryrefslogtreecommitdiff
path: root/internal/osutil/osutil.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-29 22:24:20 +0800
committerGitHub <noreply@github.com>2020-02-29 22:24:20 +0800
commit8796df8218aa306f1431c17233fbcc3e0811cc4e (patch)
tree07ba5f0e62ed68064143f029217c82c80f9b652c /internal/osutil/osutil.go
parent17ae0ed3eef54d96bd179ff7fec0540cf3024748 (diff)
conf: add unit tests (#5954)
* conf: add tests for utils.go * conf: add tests for static.go * mock os/exec * Run tests on Windows * appveyor: fix gcc not found * computed: add unit tests * log: add unit tests * log: fix tests on Windows * conf: add some tests * Finish adding tests * Cover more cases * Add tests for testutil * Add more tests
Diffstat (limited to 'internal/osutil/osutil.go')
-rw-r--r--internal/osutil/osutil.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/osutil/osutil.go b/internal/osutil/osutil.go
index 827988a0..3af67570 100644
--- a/internal/osutil/osutil.go
+++ b/internal/osutil/osutil.go
@@ -25,9 +25,9 @@ func IsExist(path string) bool {
// CurrentUsername returns the current system user via environment variables.
func CurrentUsername() string {
- curUserName := os.Getenv("USER")
- if len(curUserName) > 0 {
- return curUserName
+ username := os.Getenv("USER")
+ if len(username) > 0 {
+ return username
}
return os.Getenv("USERNAME")