1
1
mirror of https://github.com/wader/fq.git synced 2024-10-04 07:27:08 +03:00

doc: Typos and add note about Try* functions

This commit is contained in:
Mattias Wadman 2022-06-30 12:23:55 +02:00
parent 53ca5f2511
commit b10061196f
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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]`