Skip to content

Rename fields of printed structs to snake case #85

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

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/device/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (r createResult) Data() interface{} {

func (r createResult) String() string {
return fmt.Sprintf(
"name: %s\nid: %s\nboard: %s\nserial-number: %s\nfqbn: %s",
"name: %s\nid: %s\nboard: %s\nserial_number: %s\nfqbn: %s",
r.device.Name,
r.device.ID,
r.device.Board,
Expand Down
2 changes: 1 addition & 1 deletion cli/device/creategeneric.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r createGenericResult) Data() interface{} {

func (r createGenericResult) String() string {
return fmt.Sprintf(
"id: %s\nsecret-key: %s\nname: %s\nboard: %s\nserial-number: %s\nfqbn: %s",
"id: %s\nsecret_key: %s\nname: %s\nboard: %s\nserial_number: %s\nfqbn: %s",
r.device.ID,
r.device.Password,
r.device.Name,
Expand Down
4 changes: 2 additions & 2 deletions cli/device/createlora.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func (r createLoraResult) Data() interface{} {

func (r createLoraResult) String() string {
return fmt.Sprintf(
"name: %s\nid: %s\nboard: %s\nserial-number: %s\nfqbn: %s"+
"\napp-eui: %s\napp-key: %s\neui: %s",
"name: %s\nid: %s\nboard: %s\nserial_number: %s\nfqbn: %s"+
"\napp_eui: %s\napp_key: %s\neui: %s",
r.device.Name,
r.device.ID,
r.device.Board,
Expand Down
2 changes: 1 addition & 1 deletion cli/thing/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r cloneResult) Data() interface{} {

func (r cloneResult) String() string {
return fmt.Sprintf(
"name: %s\nid: %s\ndevice-id: %s\nvariables: %s",
"name: %s\nid: %s\ndevice_id: %s\nvariables: %s",
r.thing.Name,
r.thing.ID,
r.thing.DeviceID,
Expand Down
2 changes: 1 addition & 1 deletion cli/thing/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (r createResult) Data() interface{} {

func (r createResult) String() string {
return fmt.Sprintf(
"name: %s\nid: %s\ndevice-id: %s\nvariables: %s",
"name: %s\nid: %s\ndevice_id: %s\nvariables: %s",
r.thing.Name,
r.thing.ID,
r.thing.DeviceID,
Expand Down
2 changes: 1 addition & 1 deletion command/device/creategeneric.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type CreateGenericParams struct {
// parameters of a generic Arduino IoT Cloud device.
type DeviceGenericInfo struct {
DeviceInfo
Password string `json:"secret-key"`
Password string `json:"secret_key"`
}

// CreateGeneric command is used to add a new generic device to Arduino IoT Cloud.
Expand Down
4 changes: 2 additions & 2 deletions command/device/createlora.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const (
// parameters of an Arduino IoT Cloud LoRa device.
type DeviceLoraInfo struct {
DeviceInfo
AppEUI string `json:"app-eui"`
AppKey string `json:"app-key"`
AppEUI string `json:"app_eui"`
AppKey string `json:"app_key"`
EUI string `json:"eui"`
}

Expand Down
2 changes: 1 addition & 1 deletion command/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type DeviceInfo struct {
Name string `json:"name"`
ID string `json:"id"`
Board string `json:"board"`
Serial string `json:"serial-number"`
Serial string `json:"serial_number"`
FQBN string `json:"fqbn"`
Tags []string `json:"tags,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion command/thing/thing.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
type ThingInfo struct {
Name string `json:"name"`
ID string `json:"id"`
DeviceID string `json:"device-id"`
DeviceID string `json:"device_id"`
Variables []string `json:"variables"`
Tags []string `json:"tags,omitempty"`
}
Expand Down