From 426237fefe2b3b33d99602ab32bbdc1422c84860 Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Sun, 12 Mar 2017 23:18:38 +0000 Subject: [PATCH 1/5] Fixes configuration loading since last changes --- cmd/commands/bale/bale.go | 8 ++-- cmd/commands/generate/generate.go | 17 +++++++++ cmd/commands/migrate/migrate.go | 20 +++++++++- cmd/commands/run/run.go | 8 ++-- config/conf.go | 63 +++++++++++++++++++------------ 5 files changed, 83 insertions(+), 33 deletions(-) diff --git a/cmd/commands/bale/bale.go b/cmd/commands/bale/bale.go index 82ce5b2..7fcf9c6 100644 --- a/cmd/commands/bale/bale.go +++ b/cmd/commands/bale/bale.go @@ -11,7 +11,6 @@ // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. - package bale import ( @@ -43,8 +42,11 @@ var CmdBale = &commands.Command{ It will auto-generate an unpack function to the main package then run it during the runtime. This is mainly used for zealots who are requiring 100% Go code. `, - PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, - Run: runBale, + PreRun: func(cmd *commands.Command, args []string) { + version.ShowShortVersionBanner() + config.LoadConfig() + }, + Run: runBale, } func init() { diff --git a/cmd/commands/generate/generate.go b/cmd/commands/generate/generate.go index f679514..d7aedf8 100644 --- a/cmd/commands/generate/generate.go +++ b/cmd/commands/generate/generate.go @@ -1,3 +1,16 @@ +// Copyright 2013 bee authors +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. package generate import ( @@ -104,6 +117,8 @@ func scaffold(cmd *commands.Command, args []string, currpath string) { beeLogger.Log.Fatal("Wrong number of arguments. Run: bee help generate") } + config.LoadConfig() + cmd.Flag.Parse(args[2:]) if generate.SQLDriver == "" { generate.SQLDriver = utils.DocValue(config.Conf.Database.Driver) @@ -126,6 +141,8 @@ func scaffold(cmd *commands.Command, args []string, currpath string) { } func appCode(cmd *commands.Command, args []string, currpath string) { + config.LoadConfig() + cmd.Flag.Parse(args[1:]) if generate.SQLDriver == "" { generate.SQLDriver = utils.DocValue(config.Conf.Database.Driver) diff --git a/cmd/commands/migrate/migrate.go b/cmd/commands/migrate/migrate.go index 17ae222..f1964d9 100644 --- a/cmd/commands/migrate/migrate.go +++ b/cmd/commands/migrate/migrate.go @@ -1,3 +1,16 @@ +// Copyright 2013 bee authors +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. package migrate import ( @@ -39,8 +52,11 @@ var CmdMigrate = &commands.Command{ $ bee migrate refresh [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] `, - PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, - Run: RunMigration, + PreRun: func(cmd *commands.Command, args []string) { + version.ShowShortVersionBanner() + config.LoadConfig() + }, + Run: RunMigration, } var mDriver utils.DocValue diff --git a/cmd/commands/run/run.go b/cmd/commands/run/run.go index 42503c8..aa32286 100644 --- a/cmd/commands/run/run.go +++ b/cmd/commands/run/run.go @@ -11,7 +11,6 @@ // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. - package run import ( @@ -35,8 +34,11 @@ var CmdRun = &commands.Command{ Run command will supervise the filesystem of the application for any changes, and recompile/restart it. `, - PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, - Run: RunApp, + PreRun: func(cmd *commands.Command, args []string) { + version.ShowShortVersionBanner() + config.LoadConfig() + }, + Run: RunApp, } var ( diff --git a/config/conf.go b/config/conf.go index 6365121..9f11125 100644 --- a/config/conf.go +++ b/config/conf.go @@ -11,11 +11,11 @@ // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. - package config import ( "encoding/json" + "io" "io/ioutil" "os" @@ -34,7 +34,6 @@ var defaultConf = `{ "install": false }, "go_install": true, - "watch_ext": [], "dir_structure": { "watch_all": false, "controllers": "", @@ -59,8 +58,7 @@ var Conf struct { Install bool } // Indicates whether execute "go install" before "go build". - GoInstall bool `json:"go_install" yaml:"go_install"` - WatchExt []string `json:"watch_ext" yaml:"watch_ext"` + GoInstall bool `json:"go_install" yaml:"go_install"` DirStruct struct { WatchAll bool `json:"watch_all" yaml:"watch_all"` Controllers string @@ -82,37 +80,54 @@ var Conf struct { EnableNotification bool `json:"enable_notification" yaml:"enable_notification"` } -func init() { - loadConfig() -} - -// loadConfig loads customized configuration. -func loadConfig() { - beeLogger.Log.Info("Loading default configuration...") - err := json.Unmarshal([]byte(defaultConf), &Conf) - if err != nil { - beeLogger.Log.Errorf(err.Error()) - } - err = filepath.Walk(".", func(path string, fileInfo os.FileInfo, err error) error { +// LoadConfig loads the bee tool configuration. +// It looks for Beefile or bee.json in the current path, +// and falls back to default configuration in case not found. +func LoadConfig() { + err := filepath.Walk(".", func(path string, fileInfo os.FileInfo, err error) error { if err != nil { return nil } + if fileInfo.IsDir() { return nil } + switch fileInfo.Name() { case "bee.json": - beeLogger.Log.Info("Loading configuration from 'bee.json'...") - return parseJSON(path, &Conf) + { + beeLogger.Log.Info("Loading configuration from 'bee.json'...") + err = parseJSON(path, &Conf) + if err != nil { + beeLogger.Log.Errorf("Failed to parse JSON file: %s", err) + return err + } + return io.EOF + } case "Beefile": - beeLogger.Log.Info("Loading configuration from 'Beefile'...") - return parseYAML(path, &Conf) + { + beeLogger.Log.Info("Loading configuration from 'Beefile'...") + err = parseYAML(path, &Conf) + if err != nil { + beeLogger.Log.Errorf("Failed to parse YAML file: %s", err) + return err + } + return io.EOF + } } return nil }) - if err != nil { - beeLogger.Log.Errorf("Failed to parse config file: %s", err) + + // In case no configuration file found or an error different than io.EOF, + // fallback to default configuration + if err != io.EOF { + beeLogger.Log.Info("Loading default configuration...") + err = json.Unmarshal([]byte(defaultConf), &Conf) + if err != nil { + return + } } + // Check format version if Conf.Version != confVer { beeLogger.Log.Warn("Your configuration file is outdated. Please do consider updating it.") @@ -123,12 +138,10 @@ func loadConfig() { if len(Conf.DirStruct.Controllers) == 0 { Conf.DirStruct.Controllers = "controllers" } + if len(Conf.DirStruct.Models) == 0 { Conf.DirStruct.Models = "models" } - - // Append watch exts - //watchExts = append(watchExts, Conf.WatchExt...) return } From e57cc7b94eba9ebdfcfe85384fb09394898ac68a Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Mon, 13 Mar 2017 20:34:04 +0100 Subject: [PATCH 2/5] This makes sure default config is always loaded When loading configuration from Beefile or bee.json default values are not loaded. This fixes that behaviour and makes sure defaults are loaded and overrided if present in Beefile/bee.json. --- config/conf.go | 106 ++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/config/conf.go b/config/conf.go index 9f11125..717e588 100644 --- a/config/conf.go +++ b/config/conf.go @@ -27,57 +27,59 @@ import ( const confVer = 0 -var defaultConf = `{ - "version": 0, - "gopm": { - "enable": false, - "install": false - }, - "go_install": true, - "dir_structure": { - "watch_all": false, - "controllers": "", - "models": "", - "others": [] - }, - "cmd_args": [], - "envs": [], - "database": { - "driver": "mysql" - }, - "enable_reload": false, - "enable_notification": true - -} -` -var Conf struct { - Version int - // gopm support - Gopm struct { - Enable bool - Install bool - } - // Indicates whether execute "go install" before "go build". - GoInstall bool `json:"go_install" yaml:"go_install"` - DirStruct struct { - WatchAll bool `json:"watch_all" yaml:"watch_all"` - Controllers string - Models string - Others []string // Other directories. - } `json:"dir_structure" yaml:"dir_structure"` - CmdArgs []string `json:"cmd_args" yaml:"cmd_args"` - Envs []string - Bale struct { - Import string - Dirs []string - IngExt []string `json:"ignore_ext" yaml:"ignore_ext"` - } - Database struct { - Driver string - Conn string - } +var Conf = struct { + Version int + Gopm gopm + GoInstall bool `json:"go_install" yaml:"go_install"` // Indicates whether execute "go install" before "go build". + DirStruct dirStruct `json:"dir_structure" yaml:"dir_structure"` + CmdArgs []string `json:"cmd_args" yaml:"cmd_args"` + Envs []string + Bale bale + Database database EnableReload bool `json:"enable_reload" yaml:"enable_reload"` EnableNotification bool `json:"enable_notification" yaml:"enable_notification"` +}{ + GoInstall: true, + DirStruct: dirStruct{ + Others: []string{}, + }, + CmdArgs: []string{}, + Envs: []string{}, + Bale: bale{ + Dirs: []string{}, + IngExt: []string{}, + }, + Database: database{ + Driver: "mysql", + }, + EnableNotification: true, +} + +// gopm support +type gopm struct { + Enable bool + Install bool +} + +// dirStruct describes the application's directory structure +type dirStruct struct { + WatchAll bool `json:"watch_all" yaml:"watch_all"` + Controllers string + Models string + Others []string // Other directories +} + +// bale +type bale struct { + Import string + Dirs []string + IngExt []string `json:"ignore_ext" yaml:"ignore_ext"` +} + +// database holds the database connection information +type database struct { + Driver string + Conn string } // LoadConfig loads the bee tool configuration. @@ -118,14 +120,8 @@ func LoadConfig() { return nil }) - // In case no configuration file found or an error different than io.EOF, - // fallback to default configuration if err != io.EOF { beeLogger.Log.Info("Loading default configuration...") - err = json.Unmarshal([]byte(defaultConf), &Conf) - if err != nil { - return - } } // Check format version From 792cb3f311e6ffd8149a9b6acd2e77bb6d0c81f1 Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Wed, 15 Mar 2017 15:18:33 +0100 Subject: [PATCH 3/5] Load configuration for all commands This removes the filepath.Walk() when loading configuration, as it can read a Beefile from another project in the $GOPATH. Now config.LoadConfig() is called for all available commands. --- cmd/commands/bale/bale.go | 7 ++---- cmd/commands/generate/generate.go | 4 --- cmd/commands/migrate/migrate.go | 7 ++---- cmd/commands/run/run.go | 7 ++---- config/conf.go | 41 +++++++++++++++---------------- main.go | 16 ++++++++++++ 6 files changed, 42 insertions(+), 40 deletions(-) diff --git a/cmd/commands/bale/bale.go b/cmd/commands/bale/bale.go index 7fcf9c6..8ba9641 100644 --- a/cmd/commands/bale/bale.go +++ b/cmd/commands/bale/bale.go @@ -42,11 +42,8 @@ var CmdBale = &commands.Command{ It will auto-generate an unpack function to the main package then run it during the runtime. This is mainly used for zealots who are requiring 100% Go code. `, - PreRun: func(cmd *commands.Command, args []string) { - version.ShowShortVersionBanner() - config.LoadConfig() - }, - Run: runBale, + PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, + Run: runBale, } func init() { diff --git a/cmd/commands/generate/generate.go b/cmd/commands/generate/generate.go index d7aedf8..edf4691 100644 --- a/cmd/commands/generate/generate.go +++ b/cmd/commands/generate/generate.go @@ -117,8 +117,6 @@ func scaffold(cmd *commands.Command, args []string, currpath string) { beeLogger.Log.Fatal("Wrong number of arguments. Run: bee help generate") } - config.LoadConfig() - cmd.Flag.Parse(args[2:]) if generate.SQLDriver == "" { generate.SQLDriver = utils.DocValue(config.Conf.Database.Driver) @@ -141,8 +139,6 @@ func scaffold(cmd *commands.Command, args []string, currpath string) { } func appCode(cmd *commands.Command, args []string, currpath string) { - config.LoadConfig() - cmd.Flag.Parse(args[1:]) if generate.SQLDriver == "" { generate.SQLDriver = utils.DocValue(config.Conf.Database.Driver) diff --git a/cmd/commands/migrate/migrate.go b/cmd/commands/migrate/migrate.go index f1964d9..1870945 100644 --- a/cmd/commands/migrate/migrate.go +++ b/cmd/commands/migrate/migrate.go @@ -52,11 +52,8 @@ var CmdMigrate = &commands.Command{ $ bee migrate refresh [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] `, - PreRun: func(cmd *commands.Command, args []string) { - version.ShowShortVersionBanner() - config.LoadConfig() - }, - Run: RunMigration, + PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, + Run: RunMigration, } var mDriver utils.DocValue diff --git a/cmd/commands/run/run.go b/cmd/commands/run/run.go index aa32286..6820024 100644 --- a/cmd/commands/run/run.go +++ b/cmd/commands/run/run.go @@ -34,11 +34,8 @@ var CmdRun = &commands.Command{ Run command will supervise the filesystem of the application for any changes, and recompile/restart it. `, - PreRun: func(cmd *commands.Command, args []string) { - version.ShowShortVersionBanner() - config.LoadConfig() - }, - Run: RunApp, + PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, + Run: RunApp, } var ( diff --git a/config/conf.go b/config/conf.go index 717e588..529b7ae 100644 --- a/config/conf.go +++ b/config/conf.go @@ -15,7 +15,6 @@ package config import ( "encoding/json" - "io" "io/ioutil" "os" @@ -86,42 +85,43 @@ type database struct { // It looks for Beefile or bee.json in the current path, // and falls back to default configuration in case not found. func LoadConfig() { - err := filepath.Walk(".", func(path string, fileInfo os.FileInfo, err error) error { - if err != nil { - return nil - } + currentPath, err := os.Getwd() + if err != nil { + beeLogger.Log.Error(err.Error()) + } - if fileInfo.IsDir() { - return nil - } + dir, err := os.Open(currentPath) + if err != nil { + beeLogger.Log.Error(err.Error()) + } + defer dir.Close() - switch fileInfo.Name() { + files, err := dir.Readdir(-1) + if err != nil { + beeLogger.Log.Error(err.Error()) + } + + for _, file := range files { + switch file.Name() { case "bee.json": { beeLogger.Log.Info("Loading configuration from 'bee.json'...") - err = parseJSON(path, &Conf) + err = parseJSON(filepath.Join(currentPath, file.Name()), &Conf) if err != nil { beeLogger.Log.Errorf("Failed to parse JSON file: %s", err) - return err } - return io.EOF + break } case "Beefile": { beeLogger.Log.Info("Loading configuration from 'Beefile'...") - err = parseYAML(path, &Conf) + err = parseYAML(filepath.Join(currentPath, file.Name()), &Conf) if err != nil { beeLogger.Log.Errorf("Failed to parse YAML file: %s", err) - return err } - return io.EOF + break } } - return nil - }) - - if err != io.EOF { - beeLogger.Log.Info("Loading default configuration...") } // Check format version @@ -138,7 +138,6 @@ func LoadConfig() { if len(Conf.DirStruct.Models) == 0 { Conf.DirStruct.Models = "models" } - return } func parseJSON(path string, v interface{}) error { diff --git a/main.go b/main.go index 7a05f42..d9401dc 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,16 @@ +// Copyright 2013 bee authors +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. package main import ( @@ -8,6 +21,7 @@ import ( "github.com/beego/bee/cmd" "github.com/beego/bee/cmd/commands" + "github.com/beego/bee/config" "github.com/beego/bee/generate/swaggergen" "github.com/beego/bee/utils" ) @@ -46,6 +60,8 @@ func main() { c.PreRun(c, args) } + config.LoadConfig() + // Check if current directory is inside the GOPATH, // if so parse the packages inside it. if strings.Contains(currentpath, utils.GetGOPATHs()[0]+"/src") && cmd.IfGenerateDocs(c.Name(), args) { From 09f53c04008d9141182f4cc9787bfb30cce1820c Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Wed, 15 Mar 2017 17:44:29 +0100 Subject: [PATCH 4/5] Fix staticcheck emtpy branch error --- generate/swaggergen/g_docs.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/generate/swaggergen/g_docs.go b/generate/swaggergen/g_docs.go index 6c88c76..3063487 100644 --- a/generate/swaggergen/g_docs.go +++ b/generate/swaggergen/g_docs.go @@ -143,7 +143,7 @@ func GenerateDocs(curpath string) { f, err := parser.ParseFile(fset, path.Join(curpath, "routers", "router.go"), nil, parser.ParseComments) if err != nil { - // beeLogger.Log.Fatalf("Error while parsing router.go: %s", err) + beeLogger.Log.Fatalf("Error while parsing router.go: %s", err) } rootapi.Infos = swagger.Information{} @@ -352,7 +352,7 @@ func analyseControllerPkg(localName, pkgpath string) { } gopath := os.Getenv("GOPATH") if gopath == "" { - // beeLogger.Log.Fatal("GOPATH environment variable is not set or empty") + beeLogger.Log.Fatal("GOPATH environment variable is not set or empty") } pkgRealpath := "" @@ -370,7 +370,7 @@ func analyseControllerPkg(localName, pkgpath string) { } pkgCache[pkgpath] = struct{}{} } else { - // beeLogger.Log.Fatalf("Package '%s' does not exist in the GOPATH", pkgpath) + beeLogger.Log.Fatalf("Package '%s' does not exist in the GOPATH", pkgpath) } fileSet := token.NewFileSet() @@ -379,7 +379,7 @@ func analyseControllerPkg(localName, pkgpath string) { return !info.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") }, parser.ParseComments) if err != nil { - // beeLogger.Log.Fatalf("Error while parsing dir at '%s': %s", pkgpath, err) + beeLogger.Log.Fatalf("Error while parsing dir at '%s': %s", pkgpath, err) } for _, pkg := range astPkgs { for _, fl := range pkg.Files { @@ -417,7 +417,7 @@ func isSystemPackage(pkgpath string) bool { goroot = runtime.GOROOT() } if goroot == "" { - // beeLogger.Log.Fatalf("GOROOT environment variable is not set or empty") + beeLogger.Log.Fatalf("GOROOT environment variable is not set or empty") } wg, _ := filepath.EvalSymlinks(filepath.Join(goroot, "src", "pkg", pkgpath)) @@ -481,7 +481,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat ss = strings.TrimSpace(ss[pos:]) schemaName, pos := peekNextSplitString(ss) if schemaName == "" { - // beeLogger.Log.Fatalf("[%s.%s] Schema must follow {object} or {array}", controllerName, funcName) + beeLogger.Log.Fatalf("[%s.%s] Schema must follow {object} or {array}", controllerName, funcName) } if strings.HasPrefix(schemaName, "[]") { schemaName = schemaName[2:] @@ -518,7 +518,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat para := swagger.Parameter{} p := getparams(strings.TrimSpace(t[len("@Param "):])) if len(p) < 4 { - // beeLogger.Log.Fatal(controllerName + "_" + funcName + "'s comments @Param should have at least 4 params") + beeLogger.Log.Fatal(controllerName + "_" + funcName + "'s comments @Param should have at least 4 params") } para.Name = p[0] switch p[1] { @@ -533,7 +533,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat case "body": break default: - // beeLogger.Log.Warnf("[%s.%s] Unknown param location: %s. Possible values are `query`, `header`, `path`, `formData` or `body`.\n", controllerName, funcName, p[1]) + beeLogger.Log.Warnf("[%s.%s] Unknown param location: %s. Possible values are `query`, `header`, `path`, `formData` or `body`.\n", controllerName, funcName, p[1]) } para.In = p[1] pp := strings.Split(p[2], ".") @@ -564,7 +564,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat paraType = typeFormat[0] paraFormat = typeFormat[1] } else { - // beeLogger.Log.Warnf("[%s.%s] Unknown param type: %s\n", controllerName, funcName, typ) + beeLogger.Log.Warnf("[%s.%s] Unknown param type: %s\n", controllerName, funcName, typ) } if isArray { para.Type = "array" @@ -717,7 +717,7 @@ func getModel(str string) (objectname string, m swagger.Schema, realTypes []stri } } if m.Title == "" { - // beeLogger.Log.Warnf("Cannot find the object: %s", str) + beeLogger.Log.Warnf("Cannot find the object: %s", str) // TODO remove when all type have been supported //os.Exit(1) } @@ -808,7 +808,7 @@ func parseObject(d *ast.Object, k string, m *swagger.Schema, realTypes *[]string mp.Default = str2RealType(res[1], realType) } else { - // beeLogger.Log.Warnf("Invalid default value: %s", defaultValue) + beeLogger.Log.Warnf("Invalid default value: %s", defaultValue) } } @@ -946,7 +946,7 @@ func str2RealType(s string, typ string) interface{} { } if err != nil { - // beeLogger.Log.Warnf("Invalid default value type '%s': %s", typ, s) + beeLogger.Log.Warnf("Invalid default value type '%s': %s", typ, s) return s } From 64a8570c7067a65814ceafba81b57b69676e4d64 Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Wed, 15 Mar 2017 17:45:51 +0100 Subject: [PATCH 5/5] Ignore gosimple's S1024 check for go1.8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1f67569..551a2ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ install: script: - go vet $(go list ./... | grep -v /vendor/) - structcheck $(go list ./... | grep -v /vendor/) - - gosimple $(go list ./... | grep -v /vendor/) + - gosimple -ignore "github.com/beego/bee/cmd/commands/run/*.go:S1024" $(go list ./... | grep -v /vendor/) - staticcheck $(go list ./... | grep -v /vendor/) - unused $(go list ./... | grep -v /vendor/) - unconvert $(go list ./... | grep -v /vendor/)