Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
## Table of Contents

- [Install](#install)
- [Type](#type)
- [Usage](#usage)
- [Importing Code constant](#importing-code-constant)
- [Code from string](#code-from-string)
- [Code from uint64](#code-from-uint64)
- [Generator](#generator)
- [With old table.csv](#with-old-tablecsv)
- [With updated table.csv](#with-updated-tablecsv)
- [Maintainers](#maintainers)
- [Contribute](#contribute)
- [License](#license)
Expand Down Expand Up @@ -61,15 +67,31 @@ rawCode := multicodec.Code(0x55)

## Generator

### With old table.csv

To generate the constants yourself:

git clone https://github.com/multiformats/go-multicodec
cd go-multicodec
git submodule init && git submodule update
go generate
```console
$ git clone https://github.com/multiformats/go-multicodec
$ cd go-multicodec
$ git submodule init && git submodule update
$ go generate
```

Note: You may need to install `stringer` via `go install golang.org/x/tools/cmd/stringer`.

### With updated table.csv

To generate the constants for the latest [table.csv](https://github.com/multiformats/multicodec/blob/master/table.csv):

```console
$ git clone https://github.com/multiformats/go-multicodec
$ cd go-multicodec
$ git submodule init
$ git submodule update --remote # updates ./multicodec/table.csv to upstream version
$ go generate
```

## Maintainers

[@mvdan](https://github.com/mvdan).
Expand Down
Loading