Created
June 20, 2016 08:25
-
-
Save xianlubird/e98758f58b2cecc875e7e3723c5ba6d0 to your computer and use it in GitHub Desktop.
remove slice while loop a slice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i := len(config.Applications) - 1; i >= 0; i-- { | |
application := config.Applications[i] | |
// Condition to decide if current element has to be deleted: | |
if haveToDelete { | |
config.Applications = append(config.Applications[:i], | |
config.Applications[i+1:]...) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment