Logo
Explore Help
Register Sign In
Nemcio/Gogs
1
0
Fork 0
You've already forked Gogs
mirror of https://github.com/gogs/gogs.git synced 2026-01-06 07:30:01 +01:00
Code Issues Packages Projects Releases Wiki Activity
Files
db4bf20df33f008fa16fb1c813cc7ee14673d038
Gogs/internal/user/user.go

19 lines
344 B
Go
Raw Normal View History

Factor out function to get the current user The same logic was duplicated in three places. Factor it out so that we can add further fallbacks in a single place.
2015-07-31 08:50:11 +02:00
// 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 (
The pruning for the synchronized mirrors is a option now. Default value: enable_prune = true (#3246) Executed go fmt getEngine() not handles DB parameters (#2972) (#2974) Uses .AllCols() for Update in updateMirror() Spanish traslation removed Fixed a wrong way to ommit the --prune option in process.ExecDir() for MirrorUpdate function
2016-07-09 07:22:28 +02:00
"os"
Factor out function to get the current user The same logic was duplicated in three places. Factor it out so that we can add further fallbacks in a single place.
2015-07-31 08:50:11 +02:00
)
func CurrentUsername() string {
curUserName := os.Getenv("USER")
if len(curUserName) > 0 {
return curUserName
}
return os.Getenv("USERNAME")
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.1 Page: 56ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API