Skip to content

Bug: make lint error #233

@luhaoling

Description

@luhaoling

What happened?

When I make lint in chat, I met this error. As follows. I don't know how to solve.
cmd/api/admin-api/main.go:28:2: could not import github.com/OpenIMSDK/chat/pkg/common/config (-: # github.com/OpenIMSDK/chat/pkg/common/config
pkg/common/config/config.go:113:1: syntax error: non-declaration statement outside function body
pkg/common/config/config.go:115:1: syntax error: imports must appear before other declarations
pkg/common/config/im.go:71:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:164:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:166:1: syntax error: imports must appear before other declarations) (typecheck)
"github.com/OpenIMSDK/chat/pkg/common/config"
^
cmd/api/chat-api/main.go:31:2: could not import github.com/OpenIMSDK/chat/pkg/common/config (-: # github.com/OpenIMSDK/chat/pkg/common/config
pkg/common/config/config.go:113:1: syntax error: non-declaration statement outside function body
pkg/common/config/config.go:115:1: syntax error: imports must appear before other declarations
pkg/common/config/im.go:71:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:164:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:166:1: syntax error: imports must appear before other declarations) (typecheck)
"github.com/OpenIMSDK/chat/pkg/common/config"
^
cmd/rpc/admin-rpc/main.go:26:2: could not import github.com/OpenIMSDK/chat/pkg/common/config (-: # github.com/OpenIMSDK/chat/pkg/common/config
pkg/common/config/config.go:113:1: syntax error: non-declaration statement outside function body
pkg/common/config/config.go:115:1: syntax error: imports must appear before other declarations
pkg/common/config/im.go:71:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:164:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:166:1: syntax error: imports must appear before other declarations) (typecheck)
"github.com/OpenIMSDK/chat/pkg/common/config"
^
cmd/rpc/chat-rpc/main.go:26:2: could not import github.com/OpenIMSDK/chat/pkg/common/config (-: # github.com/OpenIMSDK/chat/pkg/common/config
pkg/common/config/config.go:113:1: syntax error: non-declaration statement outside function body
pkg/common/config/config.go:115:1: syntax error: imports must appear before other declarations
pkg/common/config/im.go:71:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:164:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:166:1: syntax error: imports must appear before other declarations) (typecheck)
"github.com/OpenIMSDK/chat/pkg/common/config"
^
tools/component/component.go:5:2: could not import github.com/OpenIMSDK/chat/pkg/common/config (-: # github.com/OpenIMSDK/chat/pkg/common/config
pkg/common/config/config.go:113:1: syntax error: non-declaration statement outside function body
pkg/common/config/config.go:115:1: syntax error: imports must appear before other declarations
pkg/common/config/im.go:71:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:164:1: syntax error: non-declaration statement outside function body
pkg/common/config/parse.go:166:1: syntax error: imports must appear before other declarations) (typecheck)
"github.com/OpenIMSDK/chat/pkg/common/config"
^
make: *** [Makefile:240: lint] Error 1

What did you expect to happen?

none

How can we reproduce it (as minimally and precisely as possible)?

none

Anything else we need to know?

No response

version

```console $ {name} version # paste output here ```

Cloud provider

none

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

Checklist
  • pkg/common/config/config.go ⚠️ No Changes Made
  • pkg/common/config/im.go ✅ Commit e8618aa
  • pkg/common/config/parse.go ⚠️ No Changes Made
  • cmd/api/admin-api/main.go ⚠️ No Changes Made
  • cmd/api/chat-api/main.go ⚠️ No Changes Made
  • cmd/rpc/admin-rpc/main.go ⚠️ No Changes Made
  • cmd/rpc/chat-rpc/main.go ⚠️ No Changes Made
  • tools/component/component.go ⚠️ No Changes Made
  • pkg/common/config/config.go ❌ Sandbox failed so I made additional changes
  • pkg/common/config/im.go ❌ Sandbox failed so I made additional changes
  • pkg/common/config/parse.go ❌ Sandbox failed so I made additional changes
  • cmd/api/admin-api/main.go ❌ Sandbox failed so I made additional changes
  • cmd/api/chat-api/main.go ❌ Sandbox failed so I made additional changes
  • cmd/rpc/admin-rpc/main.go ❌ Sandbox failed so I made additional changes
  • cmd/rpc/chat-rpc/main.go ❌ Sandbox failed so I made additional changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions