-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved generic removeEmptyTokens func into a common package
- Loading branch information
Preslav Mihaylov
committed
Jul 18, 2020
1 parent
465c326
commit 8cd87dc
Showing
2 changed files
with
17 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Package common contains a bunch of small utility functions used throughout different independent other packages | ||
package common | ||
|
||
// RemoveEmptyTokens of a splitted string. Tokens such as "" are removed. | ||
func RemoveEmptyTokens(ss []string) []string { | ||
res := []string{} | ||
for _, s := range ss { | ||
if s != "" { | ||
res = append(res, s) | ||
} | ||
} | ||
|
||
return res | ||
} |
This file contains 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