Usage of both value and pointer receivers GO-W1029
Anti-pattern
Major
4 months ago4 months old
Type "SecurityData" has both value and pointer receivers
20	return ""
21}
22
23func (data *SecurityData) Fetch() {24	data.Dns = DnsServers()
25	data.FirewallEnabled = FirewallState()
26	data.FirewallStealth = FirewallStealthState()
Type "SecurityData" has both value and pointer receivers
13	return &SecurityData{}
14}
15
16func (data SecurityData) DnsAt(idx int) string {17	if len(data.Dns) > idx {
18		return data.Dns[idx]
19	}
Type "AlertState" has both value and pointer receivers
 46}
 47
 48// UnmarshalJSON unmashals a quoted json string to the enum value
 49func (s *AlertState) UnmarshalJSON(b []byte) error { 50	var j string
 51	err := json.Unmarshal(b, &j)
 52	if err != nil {
Type "AlertState" has both value and pointer receivers
 38}
 39
 40// MarshalJSON marshals the enum as a quoted json string
 41func (s AlertState) MarshalJSON() ([]byte, error) { 42	buffer := bytes.NewBufferString(`"`)
 43	buffer.WriteString(toString[s])
 44	buffer.WriteString(`"`)