Skip to content

Commit

Permalink
revert(sdk/go): Revert changes to String & marshaling method receivers)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFriel committed Oct 11, 2022
1 parent a09bb93 commit 4edd7ff
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions sdk/go/common/resource/config/key.go
Expand Up @@ -70,7 +70,7 @@ func (k *Key) Name() string {
return k.name
}

func (k *Key) MarshalJSON() ([]byte, error) {
func (k Key) MarshalJSON() ([]byte, error) {
return json.Marshal(k.String())
}

Expand All @@ -90,7 +90,7 @@ func (k *Key) UnmarshalJSON(b []byte) error {
return nil
}

func (k *Key) MarshalYAML() (interface{}, error) {
func (k Key) MarshalYAML() (interface{}, error) {
return k.String(), nil
}

Expand All @@ -110,7 +110,7 @@ func (k *Key) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil
}

func (k *Key) String() string {
func (k Key) String() string {
return k.namespace + ":" + k.name
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/go/common/resource/resource_id.go
Expand Up @@ -30,8 +30,8 @@ import (
type ID string

// String converts a resource ID into a string.
func (id *ID) String() string {
return string(*id)
func (id ID) String() string {
return string(id)
}

// StringPtr converts an optional ID into an optional string.
Expand Down
2 changes: 1 addition & 1 deletion sdk/go/common/util/cmdutil/console.go
Expand Up @@ -152,7 +152,7 @@ func MeasureText(text string) int {
return uniseg.GraphemeClusterCount(clean)
}

func (table Table) ToStringWithGap(columnGap string) string {
func (table *Table) ToStringWithGap(columnGap string) string {
columnCount := len(table.Headers)

// Figure out the preferred column width for each column. It will be set to the max length of
Expand Down
2 changes: 1 addition & 1 deletion sdk/go/common/workspace/plugins.go
Expand Up @@ -622,7 +622,7 @@ func (info *PluginInfo) Spec() PluginSpec {
return PluginSpec{Name: info.Name, Kind: info.Kind, Version: info.Version}
}

func (info *PluginInfo) String() string {
func (info PluginInfo) String() string {
var version string
if v := info.Version; v != nil {
version = fmt.Sprintf("-%s", v)
Expand Down
4 changes: 2 additions & 2 deletions sdk/go/common/workspace/project.go
Expand Up @@ -348,7 +348,7 @@ func (info *ProjectRuntimeInfo) SetOption(key string, value interface{}) {
info.options[key] = value
}

func (info *ProjectRuntimeInfo) MarshalYAML() (interface{}, error) {
func (info ProjectRuntimeInfo) MarshalYAML() (interface{}, error) {
if info.options == nil || len(info.options) == 0 {
return info.name, nil
}
Expand All @@ -359,7 +359,7 @@ func (info *ProjectRuntimeInfo) MarshalYAML() (interface{}, error) {
}, nil
}

func (info *ProjectRuntimeInfo) MarshalJSON() ([]byte, error) {
func (info ProjectRuntimeInfo) MarshalJSON() ([]byte, error) {
if info.options == nil || len(info.options) == 0 {
return json.Marshal(info.name)
}
Expand Down

0 comments on commit 4edd7ff

Please sign in to comment.