Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Jan 19, 2024
1 parent 4af503a commit f0c8f9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zabbix.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewClient(address, hostname string) (*Client, error) {
// ////////////////////////////////////////////////////////////////////////////////// //

// Add adds new metric to stack
func (c *Client) Add(key string, value interface{}) *Metric {
func (c *Client) Add(key string, value any) *Metric {
now := time.Now()
metric := &Metric{
id: len(c.data),
Expand Down Expand Up @@ -162,7 +162,7 @@ func writeToConnection(conn *net.TCPConn, data []byte, timeout time.Duration) er
}

// formatValue convert value to string
func formatValue(v interface{}) string {
func formatValue(v any) string {
switch t := v.(type) {
case float32:
return fmt.Sprintf("%.6f", t)
Expand Down

0 comments on commit f0c8f9c

Please sign in to comment.