Skip to content

Commit c5889bd

Browse files
committed
remove tags type introducing an exported function
1 parent a1aeead commit c5889bd

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

command/device/device.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type DeviceInfo struct {
3535

3636
func getDeviceInfo(device *iotclient.ArduinoDevicev2) (*DeviceInfo, error) {
3737
// Retrieve device tags
38-
tags, err := tag.Tags(device.Tags).Info()
38+
tags, err := tag.TagsInfo(device.Tags)
3939
if err != nil {
4040
return nil, err
4141
}

command/tag/tag.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ package tag
22

33
import "fmt"
44

5-
type Tags map[string]interface{}
6-
7-
// Info transforms tags into user-readable strings
5+
// TagsInfo transforms tags into user-readable strings
86
// An error is returned if a tag value is not a string
9-
func (t Tags) Info() ([]string, error) {
7+
func TagsInfo(tags map[string]interface{}) ([]string, error) {
108
var str []string
11-
for key, value := range t {
9+
for key, value := range tags {
1210
if valStr, ok := value.(string); ok {
1311
str = append(str, key+": "+valStr)
1412
} else {

0 commit comments

Comments
 (0)