aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.go
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2020-03-26 22:03:15 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2020-03-26 22:03:15 +0000
commitfeff62b8fcff9709dc6c7f0b56ce80a288367f29 (patch)
tree68fe8a643179ee60d83ec2a39e1f3a4e2ac77cde /lib/lib.go
parent3216dc9b8d876f24ed561e81c2a1fb91926cb57a (diff)
Standardize the project layout
https://github.com/golang-standards/project-layout seems sensible.
Diffstat (limited to 'lib/lib.go')
-rw-r--r--lib/lib.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/lib.go b/lib/lib.go
deleted file mode 100644
index a35cb13..0000000
--- a/lib/lib.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019, Grégoire Duchêne <gduchene@awhk.org>
-//
-// Use of this source code is governed by the ISC license that can be
-// found in the LICENSE file.
-
-package lib
-
-import (
- "fmt"
- "os"
- "strings"
-)
-
-func GetBody(pkg string) string {
- dest := GetDest(os.Getenv("PREFIX"), os.Getenv("DEST"), pkg)
- return fmt.Sprintf(`<!doctype html>
-<meta name="go-import" content="%s %s %s">
-<title>go-import-redirect</title>
-`, pkg, os.Getenv("VCS"), dest)
-}
-
-func GetDest(srcPrefix, destPrefix, pkg string) string {
- srcPrefix = strings.TrimRight(srcPrefix, "/")
- destPrefix = strings.TrimRight(destPrefix, "/")
- path := strings.TrimLeft(strings.TrimPrefix(pkg, srcPrefix), "/")
- return destPrefix + "/" + strings.Split(path, "/")[0]
-}