From 255b502460607c2216fb5271366f039788aa10db Mon Sep 17 00:00:00 2001 From: John Guo Date: Thu, 17 Feb 2022 17:15:09 +0800 Subject: [PATCH] README update --- cmd/gf/README.MD | 26 ++++++-------------------- net/ghttp/ghttp_server.go | 6 +++--- os/gfile/gfile_search.go | 4 ++-- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/cmd/gf/README.MD b/cmd/gf/README.MD index 545308986..16e52caac 100644 --- a/cmd/gf/README.MD +++ b/cmd/gf/README.MD @@ -5,35 +5,21 @@ ## 1. Install -### 1). Manually Install - -> You might need setting the goproxy to make through building. -> Please make sure your Golang version > v1.15. - -1. Latest version - ``` - go install github.com/gogf/gf/cmd/gf/v2 - ``` - -2. Check installation - ``` - gf -v - ``` -### 2). PreBuilt Binary - You can also install `gf` tool using pre-built binaries: https://github.com/gogf/gf/releases -After downloads, please use `gf_xxx_xxx install` command to install gf binary to system binary path. - 1. `Mac` ```shell - wget -O gf https://github.com/gogf/gf/releases/download/v2.0.0-rc2/gf_darwin_amd64 && chmod +x gf && ./gf install + # Intel. + wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_darwin_amd64 && chmod +x gf && ./gf install && rm ./gf + + # M1. + wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_darwin_arm64 && chmod +x gf && ./gf install && rm ./gf ``` > If you're using `zsh`, you might need rename your alias by command `alias gf=gf` to resolve the conflicts between `gf` and `git fetch`. 2. `Linux` ```shell - wget -O gf https://github.com/gogf/gf/releases/download/v2.0.0-rc2/gf_linux_amd64 && chmod +x gf && ./gf install + wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64 && chmod +x gf && ./gf install && rm ./gf ``` 3. `Windows` diff --git a/net/ghttp/ghttp_server.go b/net/ghttp/ghttp_server.go index 77a7dce18..ce4b6c2b4 100644 --- a/net/ghttp/ghttp_server.go +++ b/net/ghttp/ghttp_server.go @@ -139,7 +139,7 @@ func (s *Server) Start() error { // OpenApi specification json producing handler. if s.config.OpenApiPath != "" { s.BindHandler(s.config.OpenApiPath, s.openapiSpec) - s.Logger().Debugf( + s.Logger().Infof( ctx, `openapi specification is serving at address: %s%s`, s.getListenAddress(), @@ -147,12 +147,12 @@ func (s *Server) Start() error { ) } else { if s.config.SwaggerPath != "" { - s.Logger().Notice( + s.Logger().Warning( ctx, `openapi specification is disabled but swagger ui is serving, which might make no sense`, ) } else { - s.Logger().Debug( + s.Logger().Info( ctx, `openapi specification is disabled`, ) diff --git a/os/gfile/gfile_search.go b/os/gfile/gfile_search.go index 6589fa31e..a0d06999d 100644 --- a/os/gfile/gfile_search.go +++ b/os/gfile/gfile_search.go @@ -18,7 +18,7 @@ import ( // prioritySearchPaths, Pwd()、SelfDir()、MainPkgPath(). // It returns the absolute file path of `name` if found, or en empty string if not found. func Search(name string, prioritySearchPaths ...string) (realPath string, err error) { - // Check if it's a absolute path. + // Check if it's an absolute path. realPath = RealPath(name) if realPath != "" { return @@ -46,7 +46,7 @@ func Search(name string, prioritySearchPaths ...string) (realPath string, err er // If it fails searching, it returns formatted error. if realPath == "" { buffer := bytes.NewBuffer(nil) - buffer.WriteString(fmt.Sprintf("cannot find file/folder \"%s\" in following paths:", name)) + buffer.WriteString(fmt.Sprintf(`cannot find "%s" in following paths:`, name)) array.RLockFunc(func(array []string) { for k, v := range array { buffer.WriteString(fmt.Sprintf("\n%d. %s", k+1, v))