Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper functions for checking data types #82

Open
bluetechy opened this issue Jun 13, 2019 · 0 comments
Open

Add helper functions for checking data types #82

bluetechy opened this issue Jun 13, 2019 · 0 comments

Comments

@bluetechy
Copy link

I like your project a lot. Although I know this project is dedicated to cast variables from one data type to another, it would be nice to have some helper functions to simplify the checking of a variable's data type such as the following function:

func IsArray(v interface{}) bool {
	rv := reflect.ValueOf(v)
	return rv.Kind() == reflect.Array || rv.Kind() == reflect.Slice
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant