Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 20:29:11 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 20:29:11 +0300
commit920b15f69cd7749ab5f45b121132e92de2ef6e15 (patch)
tree1b7fed68042a8a537fe1c8e8a59a3cbdc9176ee6 /main.go
parentf97ebb63782cb6ac681268651a2234e942b7e90a (diff)
Reduce code complexity
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/main.go b/main.go
index 586a81a4..3a6cdd9c 100644
--- a/main.go
+++ b/main.go
@@ -102,6 +102,14 @@ func (a *theApp) UpdateDomains(domains domains) {
a.lock.Unlock()
}
+func resolve() {
+ fullPath, err := filepath.EvalSymlinks(*pagesRoot)
+ if err != nil {
+ log.Fatalln(err)
+ }
+ *pagesRoot = fullPath
+}
+
func main() {
var wg sync.WaitGroup
var app theApp
@@ -109,12 +117,7 @@ func main() {
fmt.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION)
fmt.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages")
flag.Parse()
-
- fullPath, err := filepath.EvalSymlinks(*pagesRoot)
- if err != nil {
- log.Fatalln(err)
- }
- *pagesRoot = fullPath
+ resolve()
// Listen for HTTP
if *listenHTTP != "" {