Skip to content

Commit

Permalink
Merge pull request #203 from testwill/close_file
Browse files Browse the repository at this point in the history
fix: close go.mod
  • Loading branch information
wubin1989 authored May 26, 2024
2 parents 30545ae + 6f12952 commit b53c03d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/internal/openapi/v3/codegen/server/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func GenSvcGo(dir string, docPath string) {
if modf, err = os.Open(modfile); err != nil {
panic(err)
}
defer modf.Close()
reader := bufio.NewReader(modf)
firstLine, _ := reader.ReadString('\n')
modName := strings.TrimSpace(strings.TrimPrefix(firstLine, "module"))
Expand Down

0 comments on commit b53c03d

Please sign in to comment.