Closed hsiafan closed 8 months ago
Thanks for your feedback! That should be pretty easy. Not sure about exact abbreviation though.
@hsiafan
Ok. We now have .ifempty and .ifnempty postfix completions. The first one adds len(e) == 0, the second one adds len(e) != 0.
They both should be available in the next release 0.63.0, which hopefully will be out by the end of the week, i.e. closer to Friday.
0.63.0 is out. Please try it and let us know if you have any problems with it.
0.63.0 is out. Please try it and let us know if you have any problems with it.
I have tried it, and it works just as I expected.
OS Version:
VS Code Version:
Go Version:
Code Repository (if open source):
Feature request:
What is the problem you want to solve? Checking if a slice/map/channel/string is empty is a frequently used operation in code, and adding this feature can make writing such code faster and more convenient.
What you propose us to change in the product? Add ifem postfix completion to check if the value is empty, ifnem to check if value if not empty, the code that these postfix completions expect to generate is as follows:
.