README update

This commit is contained in:
John Guo 2022-02-17 17:15:09 +08:00
parent 073869b354
commit 255b502460
3 changed files with 11 additions and 25 deletions

View File

@ -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`

View File

@ -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`,
)

View File

@ -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))