Xo is experimental. The source code is not public yet; it will be soon. Read the release notes
Menu · XO0110

Docs

XO0110: unused local binding or import

error · reported by the checker

A local let or var binding, a local constant, a pattern binding, or an import that is never read is an error, because dead names usually mean a forgotten step. Function and closure parameters, names starting with _, and _ itself are not covered. A var that is only assigned and never read also counts as unused. xo fix removes unused bindings. See core 3.1.

Example

use std/json

fn f() -> Int {
  let x = 1
  2
}

Fix

fn f() -> Int {
  let x = 1
  x + 1
}

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