diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-11 20:29:11 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-11 20:29:11 +0300 |
commit | 920b15f69cd7749ab5f45b121132e92de2ef6e15 (patch) | |
tree | 1b7fed68042a8a537fe1c8e8a59a3cbdc9176ee6 /main.go | |
parent | f97ebb63782cb6ac681268651a2234e942b7e90a (diff) |
Reduce code complexity
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 != "" { |