Skip to content

Commit

Permalink
Fix: use g.IsNil to check nil
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleChair committed Oct 17, 2024
1 parent 062595b commit b8c0b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/goai/goai_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/frame/g"

Check failure on line 13 in net/goai/goai_example.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.22)

could not import github.com/gogf/gf/v2/frame/g (-: import cycle not allowed: import stack: [github.com/gogf/gf/v2/frame/g github.com/gogf/gf/v2/frame/gins github.com/gogf/gf/v2/net/ghttp github.com/gogf/gf/v2/net/goai github.com/gogf/gf/v2/frame/g]) (typecheck)
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gres"
Expand All @@ -31,7 +32,7 @@ type ExampleRef struct {
}

func (e *Examples) applyExamplesFile(path string) error {
if e == nil {
if g.IsNil(e) {
return nil
}
var json string
Expand Down

0 comments on commit b8c0b70

Please sign in to comment.