Which method is best (more idomatic) for testing non-empty strings (in Go)?
if len(mystring) > 0 { }
Or:
if mystring != \"\"
This seems to be premature microoptimization. The compiler is free to produce the same code for both cases or at least for these two
if len(s) != 0 { ... }
and
if s != "" { ... }
because the semantics is clearly equal.