Ad
  • Default User Avatar

    You can't compare referenced item in the slice (cosider our slice param is a reference) to an actual owned value, you need to compare matched types.
    In our case i is reference == &i and you need to compare it with reference &0.
    You might also use dereference here *i and compare it to more common 0

  • Default User Avatar

    if l should be enough, if you want to be more explicit you can use if len(l), but for me it's a bit overwhelming