-
Notifications
You must be signed in to change notification settings - Fork 669
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
NOISSUE - Change import name aliases #1868
NOISSUE - Change import name aliases #1868
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1868 +/- ##
=======================================
Coverage 67.16% 67.16%
=======================================
Files 118 118
Lines 9076 9076
=======================================
Hits 6096 6096
Misses 2351 2351
Partials 629 629
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for instances where an alias is used but not required and rebase branch to sync with master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also change in other services for example bootstrap/postgres/setup_test.go
cmd/postgres-writer/main.go
Outdated
@@ -16,10 +16,10 @@ import ( | |||
"github.com/mainflux/mainflux/consumers" | |||
consumerTracing "github.com/mainflux/mainflux/consumers/tracing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consumertracing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
03956f4
to
52c09af
Compare
Did you check this? For example in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
cmd/lora/main.go
redisconsumerTracing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the following file pgClient
is used, Please change them too
users/groups/postgres/setup_test.go
users/policies/postgres/setup_test.go
@arvindh123 , I have addressed the commenrts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix https://github.com/WashingtonKK/mainflux/blob/639cf561d0836b3fd3deefb1480717e5f10c1eac/cmd/cassandra-writer/main.go#L18 . This applies to all writers main.go
files
Also there are some places we don't need import alias for example https://github.com/WashingtonKK/mainflux/blob/639cf561d0836b3fd3deefb1480717e5f10c1eac/consumers/notifiers/api/endpoint.go#L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled --enable goimports --enable gci
on golangcilint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cmd/lora/main.go
Outdated
@@ -11,7 +11,7 @@ import ( | |||
"os" | |||
"time" | |||
|
|||
mqttPaho "github.com/eclipse/paho.mqtt.golang" | |||
mqttpaho "github.com/eclipse/paho.mqtt.golang" | |||
r "github.com/go-redis/redis/v8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the alias "r" is very vague
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same case in cmd/opcua/main.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check for other instances where an alias is used but not required
bootstrap/postgres/setup_test.go
Outdated
bootstraprepo "github.com/mainflux/mainflux/bootstrap/postgres" | ||
pgclient "github.com/mainflux/mainflux/internal/clients/postgres" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one of these requires an alias, see other instances in other files where an alias is used but not required
certs/postgres/setup_test.go
Outdated
@@ -10,7 +10,7 @@ import ( | |||
|
|||
"github.com/jmoiron/sqlx" | |||
"github.com/mainflux/mainflux/certs/postgres" | |||
pgClient "github.com/mainflux/mainflux/internal/clients/postgres" | |||
pgclient "github.com/mainflux/mainflux/internal/clients/postgres" | |||
"github.com/mainflux/mainflux/logger" | |||
dockertest "github.com/ory/dockertest/v3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't require an alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, we have:
"github.com/mainflux/mainflux/certs/postgres"
and
pgClient "github.com/mainflux/mainflux/internal/clients/postgres"
cmd/bootstrap/main.go
Outdated
authclient "github.com/mainflux/mainflux/internal/clients/grpc/auth" | ||
jaegerclient "github.com/mainflux/mainflux/internal/clients/jaeger" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these aliases required
authclient "github.com/mainflux/mainflux/internal/clients/grpc/auth" | ||
jaegerclient "github.com/mainflux/mainflux/internal/clients/jaeger" | ||
pgclient "github.com/mainflux/mainflux/internal/clients/postgres" | ||
redisclient "github.com/mainflux/mainflux/internal/clients/redis" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pgclient and redis client are needed
bootstrap/postgres/setup_test.go
Outdated
bootstrapRepo "github.com/mainflux/mainflux/bootstrap/postgres" | ||
pgClient "github.com/mainflux/mainflux/internal/clients/postgres" | ||
"github.com/mainflux/mainflux/bootstrap/postgres" | ||
pgclient "github.com/mainflux/mainflux/internal/clients/postgres" | ||
"github.com/mainflux/mainflux/logger" | ||
|
||
dockertest "github.com/ory/dockertest/v3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockertest "github.com/ory/dockertest/v3"
This is not needed as the package is dockertest
. This applies to all occurrences
a26f461
to
f0d9597
Compare
978293f
to
6a45d30
Compare
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> Fix aliases Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> FIx errors Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> Fix error Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> FIx merge Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> FIx merge Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> FIx merge Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
9ee3fde
to
c80875c
Compare
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull request title should be
MF-XXX - description
orNOISSUE - description
where XXX is ID of issue that this PR relate to.Please review the CONTRIBUTING.md file for detailed contributing guidelines.
What does this do?
Currently, in main.go files we have Go package import aliases that are not according to Go recommended practices. This PR changes the aliases of the imports to correspond to go's recommended practices.
Which issue(s) does this PR fix/relate to?
No issue
List any changes that modify/break current functionality
N/A
Have you included tests for your changes?
N/A
Did you document any new/modified functionality?
Notes