mirror of
https://github.com/jwetzell/osc-go.git
synced 2026-08-22 06:48:59 +00:00
Merge pull request #1 from jwetzell/add-more-osc-types
Add more osc types
This commit is contained in:
@@ -64,6 +64,26 @@ func argToTypedArg(rawArg string, oscType string) any {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
case "h":
|
||||||
|
number, err := strconv.ParseInt(rawArg, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
// ... handle error
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return int64(number)
|
||||||
|
case "d":
|
||||||
|
number, err := strconv.ParseFloat(rawArg, 64)
|
||||||
|
if err != nil {
|
||||||
|
// ... handle error
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return float64(number)
|
||||||
|
case "T":
|
||||||
|
return true
|
||||||
|
case "F":
|
||||||
|
return false
|
||||||
|
case "N":
|
||||||
|
return nil
|
||||||
default:
|
default:
|
||||||
fmt.Print("unhandled osc type: ")
|
fmt.Print("unhandled osc type: ")
|
||||||
fmt.Printf("%s.\n", oscType)
|
fmt.Printf("%s.\n", oscType)
|
||||||
|
|||||||
Reference in New Issue
Block a user