Skip to content

Commit f8222fd

Browse files
author
Brian Sorahan
committed
add int to type switches in shapeNumber and curveValue
1 parent ffdae3c commit f8222fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

env.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ func shapeNumber(shapeValue interface{}) Input {
198198
return C(5)
199199
}
200200
switch val := shapeValue.(type) {
201+
case int:
202+
return C(float32(val))
201203
case float64:
204+
return C(float32(val))
205+
case float32:
202206
return C(val)
203207
case Input:
204208
return val
@@ -216,6 +220,8 @@ func shapeNumber(shapeValue interface{}) Input {
216220
// isValidUgenInput returns false if val is not a valid ugen input and true otherwise.
217221
func isValidUgenInput(val interface{}) (Input, bool) {
218222
switch x := val.(type) {
223+
case int:
224+
return C(float32(x)), true
219225
case float64:
220226
return C(float32(x)), true
221227
case float32:

0 commit comments

Comments
 (0)