Directories ¶
Path | Synopsis |
---|---|
Sample program to show how the default error type is implemented.
|
Sample program to show how the default error type is implemented. |
Sample program to show how to use error variables to help the caller determine the exact error being returned.
|
Sample program to show how to use error variables to help the caller determine the exact error being returned. |
http://golang.org/src/pkg/encoding/json/decode.go Sample program to show how to implement a custom error type based on the json package in the standard library.
|
http://golang.org/src/pkg/encoding/json/decode.go Sample program to show how to implement a custom error type based on the json package in the standard library. |
Package example5 provides code to show how to implement behavior as context.
|
Package example5 provides code to show how to implement behavior as context. |
Sample program to show see if the class can find the bug.
|
Sample program to show see if the class can find the bug. |
exercises
|
|
exercise1
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge.
|
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge. |
exercise2
Create a custom error type called appError that contains three fields, err error, message string and code int.
|
Create a custom error type called appError that contains three fields, err error, message string and code int. |
template1
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge.
|
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge. |
template2
Create a custom error type called appError that contains three fields, err error, message string and code int.
|
Create a custom error type called appError that contains three fields, err error, message string and code int. |
Click to show internal directories.
Click to hide internal directories.