On Thu, Jan 10, 2019 at 6:04 PM 김용빈 <kyb...@gmail.com> wrote:

> package main
>
> func unused(x interface{}) {}
>
> func main() {
>     a := 1
>     unused(a)
> }
>

The function isn't even required here. Assigning to underscore will prevent
the error:

func main() {
    a := 1
    _ = a
}


>
> 2012년 3월 7일 수요일 오후 8시 32분 19초 UTC+9, Elazar Leibovich 님의 말:
>
>> I sometimes have a very strange error, which I can't understand its
>> source.
>>
>> One of my techniques for finding it, is isolate the problem to a very
>> small case, by commenting out pieces of the code, and noticing which pieces
>> of codes cause the problem.
>>
>> Go really helps me with it due to the short compile run cycles, but it is
>> very difficult to use this technique without leaving unused variables.
>>
>> Is there a flag that enables you to temporarily compile without this
>> warning?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to