Fix typo and clean up comments for godoc.
This commit is contained in:
parent
5131b5e390
commit
de12e101e1
4 changed files with 39 additions and 39 deletions
|
@ -495,16 +495,16 @@ func assignField(paramNum int, fieldName string, dest reflect.Value, src reflect
|
|||
// to be passed unaltered. In particular, the following conversions are
|
||||
// supported:
|
||||
//
|
||||
// - Conversion between any size signed or unsigned integer so long as the value
|
||||
// does not overflow the destination type
|
||||
// - Conversion between any size signed or unsigned integer so long as the
|
||||
// value does not overflow the destination type
|
||||
// - Conversion between float32 and float64 so long as the value does not
|
||||
// overflow the destination type
|
||||
// - Conversion from string to boolean for everything strconv.ParseBool
|
||||
// recognizes
|
||||
// - Conversion from string to any size integer for everything strconv.ParseInt
|
||||
// and strconv.ParseUint recognizes
|
||||
// - Conversion from string to any size float for everything strconv.ParseFloat
|
||||
// recognizes
|
||||
// - Conversion from string to any size integer for everything
|
||||
// strconv.ParseInt and strconv.ParseUint recognizes
|
||||
// - Conversion from string to any size float for everything
|
||||
// strconv.ParseFloat recognizes
|
||||
// - Conversion from string to arrays, slices, structs, and maps by treating
|
||||
// the string as marshalled JSON and calling json.Unmarshal into the
|
||||
// destination field
|
||||
|
|
|
@ -72,7 +72,7 @@ This approach is used since it provides the caller with access to the additional
|
|||
fields in the request that are not part of the command such as the ID.
|
||||
|
||||
Unmarshalling a received Response object is also a two step process:
|
||||
1) Unmarhsal the raw bytes into a Response struct instance via json.Unmarshal
|
||||
1) Unmarshal the raw bytes into a Response struct instance via json.Unmarshal
|
||||
2) Depending on the ID, unmarshal the Result field of the unmarshalled
|
||||
Response to create a concrete type instance
|
||||
|
||||
|
|
|
@ -478,11 +478,11 @@ func isValidResultType(kind reflect.Kind) bool {
|
|||
// an error will use the key in place of the description.
|
||||
//
|
||||
// The following outlines the required keys:
|
||||
// - "<method>--synopsis" Synopsis for the command
|
||||
// - "<method>-<lowerfieldname>" Description for each command argument
|
||||
// - "<typename>-<lowerfieldname>" Description for each object field
|
||||
// - "<method>--condition<#>" Description for each result condition
|
||||
// - "<method>--result<#>" Description for each primitive result num
|
||||
// "<method>--synopsis" Synopsis for the command
|
||||
// "<method>-<lowerfieldname>" Description for each command argument
|
||||
// "<typename>-<lowerfieldname>" Description for each object field
|
||||
// "<method>--condition<#>" Description for each result condition
|
||||
// "<method>--result<#>" Description for each primitive result num
|
||||
//
|
||||
// Notice that the "special" keys synopsis, condition<#>, and result<#> are
|
||||
// preceded by a double dash to ensure they don't conflict with field names.
|
||||
|
@ -493,17 +493,17 @@ func isValidResultType(kind reflect.Kind) bool {
|
|||
//
|
||||
// For example, consider the 'help' command itself. There are two possible
|
||||
// returns depending on the provided parameters. So, the help would be
|
||||
// generated by calling the function as follows
|
||||
// generated by calling the function as follows:
|
||||
// GenerateHelp("help", descs, (*string)(nil), (*string)(nil)).
|
||||
//
|
||||
// The following keys would then be required in the provided descriptions map:
|
||||
//
|
||||
// - "help--synopsis": "Returns a list of all commands or help for ...."
|
||||
// - "help-command": "The command to retrieve help for",
|
||||
// - "help--condition0": "no command provided"
|
||||
// - "help--condition1": "command specified"
|
||||
// - "help--result0": "List of commands"
|
||||
// - "help--result1": "Help for specified command"
|
||||
// "help--synopsis": "Returns a list of all commands or help for ...."
|
||||
// "help-command": "The command to retrieve help for",
|
||||
// "help--condition0": "no command provided"
|
||||
// "help--condition1": "command specified"
|
||||
// "help--result0": "List of commands"
|
||||
// "help--result1": "Help for specified command"
|
||||
func GenerateHelp(method string, descs map[string]string, resultTypes ...interface{}) (string, error) {
|
||||
// Look up details about the provided method and error out if not
|
||||
// registered.
|
||||
|
|
Loading…
Reference in a new issue