Documentation
¶
Overview ¶
package gen contains the commmon code used by practice exercises to generate `cases_test.go` from canonical data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorMessage ¶
ErrorMessage extracts the error string from a canonical-data.json error object. Error objects have the form {"error": "some message"}. Returns "" if v is not an error object or contains no error string.
func FloatSliceToInts ¶
FloatSliceToInts converts a JSON-decoded []any of float64 values to []int. Returns nil if v is not a []any or if any element is not a float64.
func IsError ¶
IsError reports whether v is a canonical-data.json error object (i.e., {"error": "..."}).
func PackageName ¶
PackageName gives the Go package name from an exercise slug.
Types ¶
Click to show internal directories.
Click to hide internal directories.