On Sun, Jan 15, 2017 at 10:37 AM Eric Brown <edb1...@gmail.com> wrote:
> Sorry guys, found the issue... and it's from my inexperience. The > functions that is happening to are ones I used a switch condition (which I > could've used an if condition on instead). > > I used: > > switch strings.Contains(targetDatabase.Driver, ConvertString("[!]sqlite[!]")) > { > case true: > case false: > > instead of > > if strings.Contains(targetDatabase.Driver, ConvertString("[!]sqlite[!]")) { > } else { > } > > > Of course the compiler won't always assume all possible outcomes of a > switch to ensure it's being caught... and thus the problem. Wish I > wouldn't have pre-emptively posted this now. My apologies... > Having a default: case that returns might have solved that issue as well. > > > On Saturday, January 14, 2017 at 3:31:32 PM UTC-6, Eric Brown wrote: > > Using go, when I create a function with a return... and that function uses > an if... else... condition w/ the return being passed under each, the > compiler still throws an error 'missing return at end of function'? I can > put a return at the end of the function, but it will never get to that > point because of this condition. Is that expected, or could I be doing > something different to prevent this outcome? Not that it matters... but I > hate just having random returns at the bottom of functions that don't do > anything other than satisfy this issue. > > -- > 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.