File tree Expand file tree Collapse file tree 1 file changed +25
-25
lines changed Expand file tree Collapse file tree 1 file changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -62,76 +62,76 @@ func Type(arg any) any {
62
62
}
63
63
64
64
func Abs (x any ) any {
65
- switch x .(type ) {
65
+ switch x := x .(type ) {
66
66
case float32 :
67
- if x .( float32 ) < 0 {
68
- return - x .( float32 )
67
+ if x < 0 {
68
+ return - x
69
69
} else {
70
70
return x
71
71
}
72
72
case float64 :
73
- if x .( float64 ) < 0 {
74
- return - x .( float64 )
73
+ if x < 0 {
74
+ return - x
75
75
} else {
76
76
return x
77
77
}
78
78
case int :
79
- if x .( int ) < 0 {
80
- return - x .( int )
79
+ if x < 0 {
80
+ return - x
81
81
} else {
82
82
return x
83
83
}
84
84
case int8 :
85
- if x .( int8 ) < 0 {
86
- return - x .( int8 )
85
+ if x < 0 {
86
+ return - x
87
87
} else {
88
88
return x
89
89
}
90
90
case int16 :
91
- if x .( int16 ) < 0 {
92
- return - x .( int16 )
91
+ if x < 0 {
92
+ return - x
93
93
} else {
94
94
return x
95
95
}
96
96
case int32 :
97
- if x .( int32 ) < 0 {
98
- return - x .( int32 )
97
+ if x < 0 {
98
+ return - x
99
99
} else {
100
100
return x
101
101
}
102
102
case int64 :
103
- if x .( int64 ) < 0 {
104
- return - x .( int64 )
103
+ if x < 0 {
104
+ return - x
105
105
} else {
106
106
return x
107
107
}
108
108
case uint :
109
- if x .( uint ) < 0 {
110
- return - x .( uint )
109
+ if x < 0 {
110
+ return - x
111
111
} else {
112
112
return x
113
113
}
114
114
case uint8 :
115
- if x .( uint8 ) < 0 {
116
- return - x .( uint8 )
115
+ if x < 0 {
116
+ return - x
117
117
} else {
118
118
return x
119
119
}
120
120
case uint16 :
121
- if x .( uint16 ) < 0 {
122
- return - x .( uint16 )
121
+ if x < 0 {
122
+ return - x
123
123
} else {
124
124
return x
125
125
}
126
126
case uint32 :
127
- if x .( uint32 ) < 0 {
128
- return - x .( uint32 )
127
+ if x < 0 {
128
+ return - x
129
129
} else {
130
130
return x
131
131
}
132
132
case uint64 :
133
- if x .( uint64 ) < 0 {
134
- return - x .( uint64 )
133
+ if x < 0 {
134
+ return - x
135
135
} else {
136
136
return x
137
137
}
You can’t perform that action at this time.
0 commit comments