Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · XO0422

Docs

XO0422: unknown wire name option

error · reported by the checker

A field’s wire string may carry options after a comma, as in a Go struct tag: name as "key,omitempty": T, or as ",omitempty" to keep the default key. omitempty is the only option: derive Json then leaves the field out when its value is empty (None, false, 0, “”, or no elements). Go’s other options (string, omitzero) do not exist in Xo. Remove the option. See core 2.2 and decision 0309.

Example

struct User {
  id as "id,string": Int
} derive Json

Fix

struct User {
  id as "id": Int
} derive Json

Run xo explain XO0422 for this text in a terminal, or see section 10.6 of the specification.