embed.go 935 B

1234567891011121314151617181920
  1. // Package definitions carries the VIA definition files that ship with this tool.
  2. //
  3. // The files here are the vendor's own, kept as they are served, and they are
  4. // built into the binary so that `go install` delivers them. Without that, an
  5. // installed tool finds no definitions anywhere: `go install` copies the binary
  6. // to $GOPATH/bin and creates no data directory, and the Impact 80's file cannot
  7. // be fetched either, because that board is not in VIA's collection.
  8. //
  9. // A file here is the same file a definitions directory holds, not a second copy
  10. // and not a transcription of it. A file the user places in a definitions
  11. // directory takes precedence over the one built in, so an installed tool can be
  12. // given a newer or a corrected definition without rebuilding.
  13. package definitions
  14. import "embed"
  15. // Vendored holds the definition files shipped with the tool, keyed by file name.
  16. //
  17. //go:embed *.json
  18. var Vendored embed.FS