-
Notifications
You must be signed in to change notification settings - Fork 2
Upgrading
Joshua Smith edited this page Oct 28, 2022
·
3 revisions
- requires running go version 1.18 or later
func(in trial.Input)(result interface{}, err error)
Convert to strong type
- Convert in into type Q, required by function
- Update the result interface to type B, result of function
- Add type definition to Cases
Cases[A,B]{}
Keep using trial.Input
- Keep in variable
- Update the result interface to type B, result of function
- Add type definition to Cases
Cases[trial.Input,B]{} - Make sure each Input in a case is using the
trial.Args()function
func(args ...interface{})(result interface{}, err error)
Single variable function
- Convert the args into the type A, required by function
- Update the result interface to type B, result of function
- Add type definition to Cases
Cases[A,B]{}
**Multi-variable function
- Convert the args into a multi variable type A
- Update the result interface to type B, result of function
- Add type definition to Cases
Cases[A,B]{} - It may be required to change the
Inputfield of each to the type A