-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: make lint error #233
Comments
Here's the PR! #235.⚡ Sweep Basic Tier: I'm creating this ticket using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. For more GPT-4 tickets, visit our payment portal.
Actions (click)
Install Sweep Configs: Pull Request
Step 1: 🔎 SearchingI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.chat/pkg/common/config/parse.go Lines 1 to 161 in 72bb2d5
chat/cmd/api/admin-api/main.go Lines 1 to 79 in 72bb2d5
Lines 1 to 82 in 72bb2d5
Lines 1 to 55 in 72bb2d5
chat/cmd/rpc/admin-rpc/main.go Lines 1 to 55 in 72bb2d5
Step 2: ⌨️ Coding
Modify pkg/common/config/config.go with contents:
Modify pkg/common/config/im.go with contents:
Modify pkg/common/config/parse.go with contents:
Modify cmd/api/admin-api/main.go with contents:
Modify cmd/api/chat-api/main.go with contents:
Modify cmd/rpc/admin-rpc/main.go with contents:
Modify cmd/rpc/chat-rpc/main.go with contents:
Modify tools/component/component.go with contents:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox: Step 3: 🔁 Code ReviewHere are my self-reviews of my changes at Here is the 1st review The changes made to the file "pkg/common/config/im.go" are correct, as they move the non-declaration statement inside a function. However, the provided diff does not show any changes made to the import statements, which were also part of the plan. Please ensure that all import statements are at the top of the file, before other declarations. I finished incorporating these changes. 🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
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
Cloud provider
OS version
Install tools
Checklist
pkg/common/config/config.go
pkg/common/config/im.go
✅ Commite8618aa
pkg/common/config/parse.go
cmd/api/admin-api/main.go
cmd/api/chat-api/main.go
cmd/rpc/admin-rpc/main.go
cmd/rpc/chat-rpc/main.go
tools/component/component.go
pkg/common/config/config.go
❌ Sandbox failed so I made additional changespkg/common/config/im.go
❌ Sandbox failed so I made additional changespkg/common/config/parse.go
❌ Sandbox failed so I made additional changescmd/api/admin-api/main.go
❌ Sandbox failed so I made additional changescmd/api/chat-api/main.go
❌ Sandbox failed so I made additional changescmd/rpc/admin-rpc/main.go
❌ Sandbox failed so I made additional changescmd/rpc/chat-rpc/main.go
❌ Sandbox failed so I made additional changesThe text was updated successfully, but these errors were encountered: