Which method is best (more idomatic) for testing non-empty strings (in Go)?
if len(mystring) > 0 { }
Or:
if mystring != "" { }
Or something else?
转载于:https://stackoverflow.com/questions/18594330/what-is-the-best-way-to-test-for-an-empty-string-in-go