mirror of
https://github.com/wader/fq.git
synced 2024-11-23 00:57:15 +03:00
doc: Typos and add note about Try* functions
This commit is contained in:
parent
53ca5f2511
commit
b10061196f
@ -5,7 +5,7 @@
|
||||
- Create a directory `format/<name>`
|
||||
- Copy some similar decoder, `format/format/bson.go` is quite small, to `format/<name>/<name>.go`
|
||||
- Cleanup and fill in the register struct, rename `format.BSON` and add it
|
||||
to `format/fromat.go` and don't forget to change the string constant.
|
||||
to `format/format.go` and don't forget to change the string constant.
|
||||
- Add an import to `format/all/all.go`
|
||||
|
||||
### Some general tips
|
||||
@ -38,8 +38,9 @@ Flags can be struct with bit-fields.
|
||||
|
||||
`<Field>?(<reader<length>?>|<type>Fn>)(...[, scalar.Mapper...]) <type>`
|
||||
|
||||
- If starts with `Field` a field will be added and first argument will be name of field. If not it will just read.
|
||||
- `<reader<length>?>|<type>Fn>` a reader or a reader function
|
||||
- If it starts with `Field` a field will be added and first argument will be name of field. If not it will just read.
|
||||
- `<try>?<reader<length>?>|<try>?<type>Fn>` a reader or a reader function
|
||||
- `<try>?` If prefixed with `Try` function return error instead of panic on error.
|
||||
- `<reader<length>?>` Read bits using some decoder.
|
||||
- `U16` unsigned 16 bit integer.
|
||||
- `UTF8` UTF8 with byte length as argument.
|
||||
|
@ -280,7 +280,7 @@ This type is returned by decoders and it used to represent parts of the decoed i
|
||||
|
||||
Each decode value has these properties:
|
||||
- A bit range in the input
|
||||
- Can be accessed as a binary using `tobits`/`tobytes`. Use the `start` and `size` keys to position and size.
|
||||
- Can be accessed as a binary using `tobits`/`tobytes`. Use the `start` and `size` keys to access position and size.
|
||||
- `.name` as bytes `.name | tobytes`
|
||||
- Bit 4-8 of `.name` as bits `.name | tobits[4:8]`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user