Skip to content

Commit

Permalink
Merge pull request #3603 from cmars/gccgo-nested-type-fix
Browse files Browse the repository at this point in the history
Stop using nested types.

They break the gccgo 4.9 compiler.

(Review request: http://reviews.vapour.ws/r/3008/)
  • Loading branch information
jujubot committed Oct 27, 2015
2 parents 4e3972b + 1dc5502 commit 737df18
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions cmd/juju/status/formatted.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func (s machineStatus) MarshalYAML() (interface{}, error) {
if s.Err != nil {
return errorStatus{s.Err.Error()}, nil
}
type noMethods machineStatus
return noMethods(s), nil
return machineStatusNoMarshal(s), nil
}

type serviceStatus struct {
Expand All @@ -81,16 +80,14 @@ func (s serviceStatus) MarshalJSON() ([]byte, error) {
if s.Err != nil {
return json.Marshal(errorStatus{s.Err.Error()})
}
type ssNoMethods serviceStatus
return json.Marshal(ssNoMethods(s))
return json.Marshal(serviceStatusNoMarshal(s))
}

func (s serviceStatus) MarshalYAML() (interface{}, error) {
if s.Err != nil {
return errorStatus{s.Err.Error()}, nil
}
type noMethods serviceStatus
return noMethods(s), nil
return serviceStatusNoMarshal(s), nil
}

type meterStatus struct {
Expand Down Expand Up @@ -139,8 +136,7 @@ func (s statusInfoContents) MarshalYAML() (interface{}, error) {
if s.Err != nil {
return errorStatus{s.Err.Error()}, nil
}
type noMethods statusInfoContents
return noMethods(s), nil
return statusInfoContentsNoMarshal(s), nil
}

type unitStatusNoMarshal unitStatus
Expand All @@ -156,8 +152,7 @@ func (s unitStatus) MarshalYAML() (interface{}, error) {
if s.Err != nil {
return errorStatus{s.Err.Error()}, nil
}
type noMethods unitStatus
return noMethods(s), nil
return unitStatusNoMarshal(s), nil
}

type networkStatus struct {
Expand All @@ -173,14 +168,12 @@ func (n networkStatus) MarshalJSON() ([]byte, error) {
if n.Err != nil {
return json.Marshal(errorStatus{n.Err.Error()})
}
type nNoMethods networkStatus
return json.Marshal(nNoMethods(n))
return json.Marshal(networkStatusNoMarshal(n))
}

func (n networkStatus) MarshalYAML() (interface{}, error) {
if n.Err != nil {
return errorStatus{n.Err.Error()}, nil
}
type noMethods networkStatus
return noMethods(n), nil
return networkStatusNoMarshal(n), nil
}

0 comments on commit 737df18

Please sign in to comment.