mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 14:36:32 +02:00
internal: move packages under this directory (#5836)
* Rename pkg -> internal * Rename routes -> route * Move route -> internal/route * Rename models -> db * Move db -> internal/db * Fix route2 -> route * Move cmd -> internal/cmd * Bump version
This commit is contained in:
18
internal/user/user.go
Normal file
18
internal/user/user.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func CurrentUsername() string {
|
||||
curUserName := os.Getenv("USER")
|
||||
if len(curUserName) > 0 {
|
||||
return curUserName
|
||||
}
|
||||
|
||||
return os.Getenv("USERNAME")
|
||||
}
|
||||
Reference in New Issue
Block a user