-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] module imports are not sorted #2888
Comments
Hello! Thank you for filing an issue. If this is a bug report, please include relevant logs to help us debug the problem. Join slack 🤖 to connect and communicate with our developers. |
Thank you for contributing code to OpenIM. |
Yes, feel free to submit a PR to address this request. |
I think it could more organized, readable, and maitianable, if code imports were sorted like these: import(
"standard" ...
"third-party"
"copany-libs"
"current-module"
) for example, content from repo file could be formatted with gci tool, with command like this: files=`find internal -type f -name "*.go"`
for f in $files; do
gci write \
-s standard \
-s default \
-s 'prefix(github.com/openimsdk)' \
-s localmodule $filename
done which will turn out be : package api
import (
"fmt"
"net/http"
"strings"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/go-playground/validator/v10"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"github.com/openimsdk/protocol/constant"
"github.com/openimsdk/tools/apiresp"
"github.com/openimsdk/tools/discovery"
"github.com/openimsdk/tools/log"
"github.com/openimsdk/tools/mw"
"github.com/openimsdk/open-im-server/v3/internal/api/jssdk"
"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
"github.com/openimsdk/open-im-server/v3/pkg/common/servererrs"
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
) |
OpenIM Server Version
v3.8.1
Operating System and CPU Architecture
Linux (AMD)
Deployment Method
Source Code Deployment
Bug Description and Steps to Reproduce
I think it would help to understand code better, maintain easily, if imports are sorted in order like std, third packages, privated packages from current module,
could I send a PR to fulfill this request?
Screenshots Link
No response
The text was updated successfully, but these errors were encountered: