var placeholder1 string var test1 string
Something as simple as the above results in two compiler errors stating that the variables are
declared but not used`.
A bit of Googling showed quite a few people with similar complaints, but there was one solution that seemed to fit my use-case pretty well:
var placeholder1 string var test1 string // Use discards _, _ = placeholder1, test1
By simply using a discard the compilation error can be circumvented. There’s a fairly detailed discussion on Stackoverflow: https://stackoverflow.com/a/62951339/522859
Leave a Reply