mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Compare commits
6 Commits
app.conf-c
...
v0.15.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1776bda3c | ||
|
|
d68b27ae81 | ||
|
|
ce84b78204 | ||
|
|
19ca52182d | ||
|
|
bd4663b651 | ||
|
|
d2b1730439 |
@@ -88,8 +88,9 @@ func Build(buildFlags ...string) (app *App, compileError *revel.Error) {
|
||||
revel.ImportPath, appVersion, revel.ImportPath, buildTime)
|
||||
|
||||
// TODO remove version check for versionLinkerFlags after Revel becomes Go min version to go1.5
|
||||
goVersion, _ := strconv.ParseFloat(runtime.Version()[2:5], 64)
|
||||
if goVersion < 1.5 {
|
||||
goVersion, err := strconv.ParseFloat(runtime.Version()[2:5], 64)
|
||||
// runtime.Version() may return commit hash, we assume it is above 1.5
|
||||
if goVersion < 1.5 && err == nil {
|
||||
versionLinkerFlags = fmt.Sprintf("-X %s/app.AppVersion \"%s\" -X %s/app.BuildTime \"%s\"",
|
||||
revel.ImportPath, appVersion, revel.ImportPath, buildTime)
|
||||
}
|
||||
@@ -286,7 +287,7 @@ func calcImportAliases(src *SourceInfo) map[string]string {
|
||||
}
|
||||
|
||||
func addAlias(aliases map[string]string, importPath, pkgName string) {
|
||||
alias, ok := aliases[importPath]
|
||||
alias, ok := aliases[importPath]
|
||||
if ok {
|
||||
return
|
||||
}
|
||||
@@ -297,7 +298,7 @@ func addAlias(aliases map[string]string, importPath, pkgName string) {
|
||||
func makePackageAlias(aliases map[string]string, pkgName string) string {
|
||||
i := 0
|
||||
alias := pkgName
|
||||
for containsValue(aliases, alias) {
|
||||
for containsValue(aliases, alias) || alias=="revel" {
|
||||
alias = fmt.Sprintf("%s%d", pkgName, i)
|
||||
i++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user