• philm@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    Is this a hard error? Like it doesn’t compile at all?

    Isn’t there something like #[allow(unused)] in Rust you can put over the declaration?

    • HiddenLayer5@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      1 year ago

      Never really coded in Go outside of trying it out, but as far as I know it’s a hard error.

    • flame3244@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Yes it is a hard error and Go does not compile then. You can do _ = foobar to fake variable usage. I think this is okay for testing purposes.