Skip to content

Commit 9c40c65

Browse files
committed
Fixed RPC_REQUEST_STANDARD_NAME and RPC_REQUEST_RESPONSE_UNIQUE lint warning
There is one error remaining that require a more involved refactoring.
1 parent 46956fa commit 9c40c65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2382
-2367
lines changed

cli/board/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func runAttachCommand(cmd *cobra.Command, args []string) {
6464
path = initSketchPath(path)
6565
}
6666

67-
if _, err = board.Attach(context.Background(), &rpc.BoardAttachReq{
67+
if _, err = board.Attach(context.Background(), &rpc.BoardAttachRequest{
6868
Instance: instance,
6969
BoardUri: args[0],
7070
SketchPath: path.String(),

cli/board/details.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func runDetailsCommand(cmd *cobra.Command, args []string) {
6666
fqbn = args[0]
6767
}
6868

69-
res, err := board.Details(context.Background(), &rpc.BoardDetailsReq{
69+
res, err := board.Details(context.Background(), &rpc.BoardDetailsRequest{
7070
Instance: inst,
7171
Fqbn: fqbn,
7272
})

cli/board/listall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func runListAllCommand(cmd *cobra.Command, args []string) {
5656
os.Exit(errorcodes.ErrGeneric)
5757
}
5858

59-
list, err := board.ListAll(context.Background(), &rpc.BoardListAllReq{
59+
list, err := board.ListAll(context.Background(), &rpc.BoardListAllRequest{
6060
Instance: inst,
6161
SearchArgs: args,
6262
IncludeHiddenBoards: showHiddenBoard,

cli/board/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
5858
os.Exit(errorcodes.ErrGeneric)
5959
}
6060

61-
res, err := board.Search(context.Background(), &rpc.BoardSearchReq{
61+
res, err := board.Search(context.Background(), &rpc.BoardSearchRequest{
6262
Instance: inst,
6363
SearchArgs: strings.Join(args, " "),
6464
IncludeHiddenBoards: searchFlags.showHiddenBoard,

cli/burnbootloader/burnbootloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func run(command *cobra.Command, args []string) {
6767
os.Exit(errorcodes.ErrGeneric)
6868
}
6969

70-
if _, err := upload.BurnBootloader(context.Background(), &rpc.BurnBootloaderReq{
70+
if _, err := upload.BurnBootloader(context.Background(), &rpc.BurnBootloaderRequest{
7171
Instance: instance,
7272
Fqbn: fqbn,
7373
Port: port,

cli/compile/compile.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func run(cmd *cobra.Command, args []string) {
152152
overrides = o.Overrides
153153
}
154154

155-
compileReq := &rpc.CompileReq{
155+
compileRequest := &rpc.CompileRequest{
156156
Instance: inst,
157157
Fqbn: fqbn,
158158
SketchPath: sketchPath.String(),
@@ -177,13 +177,13 @@ func run(cmd *cobra.Command, args []string) {
177177
verboseCompile := configuration.Settings.GetString("logging.level") == "debug"
178178
var compileRes *rpc.CompileResponse
179179
if output.OutputFormat == "json" {
180-
compileRes, err = compile.Compile(context.Background(), compileReq, compileOut, compileErr, verboseCompile)
180+
compileRes, err = compile.Compile(context.Background(), compileRequest, compileOut, compileErr, verboseCompile)
181181
} else {
182-
compileRes, err = compile.Compile(context.Background(), compileReq, os.Stdout, os.Stderr, verboseCompile)
182+
compileRes, err = compile.Compile(context.Background(), compileRequest, os.Stdout, os.Stderr, verboseCompile)
183183
}
184184

185185
if err == nil && uploadAfterCompile {
186-
uploadReq := &rpc.UploadReq{
186+
uploadRequest := &rpc.UploadRequest{
187187
Instance: inst,
188188
Fqbn: fqbn,
189189
SketchPath: sketchPath.String(),
@@ -198,9 +198,9 @@ func run(cmd *cobra.Command, args []string) {
198198
// TODO: do not print upload output in json mode
199199
uploadOut := new(bytes.Buffer)
200200
uploadErr := new(bytes.Buffer)
201-
_, err = upload.Upload(context.Background(), uploadReq, uploadOut, uploadErr)
201+
_, err = upload.Upload(context.Background(), uploadRequest, uploadOut, uploadErr)
202202
} else {
203-
_, err = upload.Upload(context.Background(), uploadReq, os.Stdout, os.Stderr)
203+
_, err = upload.Upload(context.Background(), uploadRequest, os.Stdout, os.Stderr)
204204
}
205205
if err != nil {
206206
feedback.Errorf("Error during Upload: %v", err)

cli/core/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) {
6060
}
6161

6262
for i, platformRef := range platformsRefs {
63-
platformDownloadreq := &rpc.PlatformDownloadReq{
63+
platformDownloadreq := &rpc.PlatformDownloadRequest{
6464
Instance: inst,
6565
PlatformPackage: platformRef.PackageName,
6666
Architecture: platformRef.Architecture,

cli/core/install.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ func runInstallCommand(cmd *cobra.Command, args []string) {
9898
}
9999

100100
for _, platformRef := range platformsRefs {
101-
platformInstallReq := &rpc.PlatformInstallReq{
101+
platformInstallRequest := &rpc.PlatformInstallRequest{
102102
Instance: inst,
103103
PlatformPackage: platformRef.PackageName,
104104
Architecture: platformRef.Architecture,
105105
Version: platformRef.Version,
106106
SkipPostInstall: DetectSkipPostInstallValue(),
107107
}
108-
_, err := core.PlatformInstall(context.Background(), platformInstallReq, output.ProgressBar(), output.TaskProgress())
108+
_, err := core.PlatformInstall(context.Background(), platformInstallRequest, output.ProgressBar(), output.TaskProgress())
109109
if err != nil {
110110
feedback.Errorf("Error during install: %v", err)
111111
os.Exit(errorcodes.ErrGeneric)

cli/core/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func runListCommand(cmd *cobra.Command, args []string) {
5757

5858
logrus.Info("Executing `arduino core list`")
5959

60-
platforms, err := core.GetPlatforms(&rpc.PlatformListReq{
60+
platforms, err := core.GetPlatforms(&rpc.PlatformListRequest{
6161
Instance: inst,
6262
UpdatableOnly: listFlags.updatableOnly,
6363
All: listFlags.all,

cli/core/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
5858
os.Exit(errorcodes.ErrGeneric)
5959
}
6060

61-
_, err = commands.UpdateIndex(context.Background(), &rpc.UpdateIndexReq{
61+
_, err = commands.UpdateIndex(context.Background(), &rpc.UpdateIndexRequest{
6262
Instance: inst,
6363
}, output.ProgressBar())
6464
if err != nil {
@@ -69,7 +69,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
6969
arguments := strings.ToLower(strings.Join(args, " "))
7070
logrus.Infof("Executing `arduino core search` with args: '%s'", arguments)
7171

72-
resp, err := core.PlatformSearch(&rpc.PlatformSearchReq{
72+
resp, err := core.PlatformSearch(&rpc.PlatformSearchRequest{
7373
Instance: inst,
7474
SearchArgs: arguments,
7575
AllVersions: allVersions,

0 commit comments

Comments
 (0)