Skip to content

Commit 0eb0cc6

Browse files
committed
Remove useless error parameter
1 parent d9566d2 commit 0eb0cc6

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

command/dashboard/extract.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ func Extract(params *ExtractParams) error {
5858
return err
5959
}
6060

61-
templ, err := template.FromDashboard(dashboard)
62-
if err != nil {
63-
return err
64-
}
61+
templ := template.FromDashboard(dashboard)
6562

6663
if params.Outfile == nil {
6764
name, ok := templ["name"].(string)

command/thing/extract.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ func Extract(params *ExtractParams) error {
5858
return err
5959
}
6060

61-
templ, err := template.FromThing(thing)
62-
if err != nil {
63-
return err
64-
}
61+
templ := template.FromThing(thing)
6562

6663
if params.Outfile == nil {
6764
name, ok := templ["name"].(string)

internal/template/extract.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
// FromThing extracts a template of type map[string]interface{} from a thing.
32-
func FromThing(thing *iotclient.ArduinoThing) (map[string]interface{}, error) {
32+
func FromThing(thing *iotclient.ArduinoThing) map[string]interface{} {
3333
template := make(map[string]interface{})
3434
template["name"] = thing.Name
3535

@@ -47,11 +47,11 @@ func FromThing(thing *iotclient.ArduinoThing) (map[string]interface{}, error) {
4747
}
4848
template["variables"] = props
4949

50-
return template, nil
50+
return template
5151
}
5252

5353
// FromDashboard extracts a template of type map[string]interface{} from a dashboard.
54-
func FromDashboard(dashboard *iotclient.ArduinoDashboardv2) (map[string]interface{}, error) {
54+
func FromDashboard(dashboard *iotclient.ArduinoDashboardv2) map[string]interface{} {
5555
template := make(map[string]interface{})
5656
template["name"] = dashboard.Name
5757

@@ -94,7 +94,7 @@ func FromDashboard(dashboard *iotclient.ArduinoDashboardv2) (map[string]interfac
9494
if len(widgets) > 0 {
9595
template["widgets"] = widgets
9696
}
97-
return template, nil
97+
return template
9898
}
9999

100100
// ToFile takes a generic template and saves it into a file,

0 commit comments

Comments
 (0)