github.com/moov-io/imagecashletter@v0.10.1/docs/usage-go.md (about) 1 --- 2 layout: page 3 title: Go library 4 hide_hero: true 5 show_sidebar: false 6 menubar: docs-menu 7 --- 8 9 # Go library 10 11 This project uses [Go Modules](https://go.dev/blog/using-go-modules) and Go v1.18 or newer. See [Golang's install instructions](https://golang.org/doc/install) for help setting up Go. You can download the source code and we offer [tagged and released versions](https://github.com/moov-io/imagecashletter/releases/latest) as well. We highly recommend you use a tagged release for production. 12 13 ``` 14 $ git@github.com:moov-io/imagecashletter.git 15 16 # Pull down into the Go Module cache 17 $ go get -u github.com/moov-io/imagecashletter 18 19 $ go doc github.com/moov-io/imagecashletter CashLetter 20 ``` 21 22 The package [`github.com/moov-io/imagecashletter`](https://pkg.go.dev/github.com/moov-io/imagecashletter) offers a Go-based Image Cash Letter file reader and writer. To get started, check out a specific example: 23 24 | ICL File | Read | Write | 25 |---------|------|-------| 26 | [Link](https://github.com/moov-io/imagecashletter/blob/master/examples/imagecashletter-read/iclFile.x937) | [Link](https://github.com/moov-io/imagecashletter/blob/master/examples/imagecashletter-read/main.go) | [Link](https://github.com/moov-io/imagecashletter/blob/master/examples/imagecashletter-write/main.go) | 27 28 ImageCashLetter's file handling behaviors can be modified to accommodate your specific use case. This is done by passing _options_ into ICL's `reader` and `writer` during instantiation. For example, to read EBCDID encoded files you would instantiate a reader with `NewReader(fd, ReadVariableLineLengthOption(), ReadEbcdicEncodingOption())`. 29 30 The following options are currently supported: 31 32 | Option | Description | 33 |-----|-----| 34 | `ReadVariableLineLengthOption` | Allows Reader to split ICL files based on the Inserted Length Field. | 35 | `ReadEbcdicEncodingOption` | Allows Reader to decode scanned lines from EBCDIC to UTF-8. | 36 | `WriteVariableLineLengthOption` | Instructs the Writer to begin each record with the appropriate Inserted Length Field. | 37 | `WriteEbcdicEncodingOption` | Allows Writer to write file in EBCDIC. |