Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Jan 9, 2025
1 parent 5fb70a9 commit 09ea7cc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 50 deletions.
6 changes: 3 additions & 3 deletions contribs/gnodev/cmd/gnodev/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (ds *App) setupHandlers(ctx context.Context) (http.Handler, error) {
}

ds.proxy.HandlePath(func(paths ...string) {
new := false
newPath := false
for _, path := range paths {
// Check if the path is an initial path.
if _, ok := initPaths[path]; ok {
Expand All @@ -243,10 +243,10 @@ func (ds *App) setupHandlers(ctx context.Context) (http.Handler, error) {
proxyLogger.Info("new monitored path",
"path", path)

new = true
newPath = true
}

if !new {
if !newPath {
return
}

Expand Down
6 changes: 3 additions & 3 deletions contribs/gnodev/cmd/gnodev/setup_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func (va *varResolver) Set(value string) error {
func setupPackagesResolver(logger *slog.Logger, cfg *devCfg, dirs ...string) (packages.Resolver, []string) {
// Add root resolvers
exampleRoot := filepath.Join(cfg.root, "examples")
localResolvers := make([]packages.Resolver, len(dirs))

var localResolvers []packages.Resolver
var paths []string
for _, dir := range dirs {
for i, dir := range dirs {
path := guessPath(cfg, dir)
resolver := packages.NewLocalResolver(path, dir)

Expand All @@ -68,7 +68,7 @@ func setupPackagesResolver(logger *slog.Logger, cfg *devCfg, dirs ...string) (pa
logger.Warn("invalid local path", "dir", dir)
}

localResolvers = append(localResolvers, resolver)
localResolvers[i] = resolver
}

resolver := packages.ChainResolvers(
Expand Down
25 changes: 0 additions & 25 deletions contribs/gnodev/cmd/gnodev/utils.go

This file was deleted.

2 changes: 0 additions & 2 deletions contribs/gnodev/pkg/dev/query_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type PackageModifier struct {
type PackageMetaMap struct {
Creator crypto.Address
Deposit std.Coins

queries map[string]PackageModifier
}

func ResolvePackageModifierQuery(bk *address.Book, path string) (PackageModifier, error) {
Expand Down
17 changes: 0 additions & 17 deletions contribs/gnodev/pkg/packages/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,6 @@ func isDraftPackages(dir string, files []fs.DirEntry) (bool, error) {
return false, nil
}

func parseFile(fset *token.FileSet, fname string, body []byte) (*gnovm.MemFile, string, error) {
f, err := parser.ParseFile(fset, fname, body, parser.PackageClauseOnly)
if err != nil {
return nil, "", fmt.Errorf("unable to parse file %q: %w", fname, err)
}

pkgname := f.Name.Name
if isTestFile(fname) {
pkgname, _, _ = strings.Cut(pkgname, "_")
}

return &gnovm.MemFile{
Name: fname,
Body: string(body),
}, f.Name.Name, nil
}

func parseGnoFile(fset *token.FileSet, fname string, body []byte) (*gnovm.MemFile, string, error) {
f, err := parser.ParseFile(fset, fname, body, parser.PackageClauseOnly)
if err != nil {
Expand Down

0 comments on commit 09ea7cc

Please sign in to comment.