Select Git revision
-
Md. Alim Ul Karim authored
"add integrated test for chmodhelper" "Left, Right DS" "stringslice - pkg- Add SliceCommon Functions" "DS hashset, hashmap return ordered string list" Closes #42, #44, #45, #48, #49, #50, #52, #53, #54, #56, #57, #58, #59 ## Introduction "add integrated test for chmodhelper" "Left, Right DS" "stringslice - pkg- Add SliceCommon Functions" "DS hashset, hashmap return ordered string list"... Note: [Template Reference](https://hackmd.io/@akarimevatix/H1Qsmq23w) ## Worked on Items - [x] - #59 - Left, Right DS - [x] - #58 - Add SliceCommon Functions - [x] - #57 - DS hashset return ordered string list - [x] - #56 - Converters NonEmpty string, DS Join to nonempty strings - [x] - #54 -Fix method signature `func NewHashsetUsingStrings(inputArray *[]string, addCapacity int, // should be removed isMakeClone ool, // should be removed) *Hashset {` - [x] - #53 - `NewCollectionUsingStrings(stringItems *[]string, isMakeClone bool) *Collection { fix copy issue` - [x] - #52 - Apply Chmod without checking dir - [x] - #50 - Basic Map Interface like slicer - [x] - #49 - Non-interactive consts - [x] - #48 - add integrated test for chmodhelper - [x] - #45 - Write Tests for PathChmods - [x] - #44 - corestre new methods - [x] - #42 - coreinstruction ## TODOs - NA ## References - N/A ## Notes - N/A ## Performed full package - [x] Code reformat  ## Analysis CheckList - [x] Run + add screenshot of CodeInspect - [x] Run `Go Install` on root - [x] Run `go tests/test` successfully [no failing tests] - [x] Run `go run cmd/main/main.go` successfully [no build fail] See merge request !47
Md. Alim Ul Karim authored"add integrated test for chmodhelper" "Left, Right DS" "stringslice - pkg- Add SliceCommon Functions" "DS hashset, hashmap return ordered string list" Closes #42, #44, #45, #48, #49, #50, #52, #53, #54, #56, #57, #58, #59 ## Introduction "add integrated test for chmodhelper" "Left, Right DS" "stringslice - pkg- Add SliceCommon Functions" "DS hashset, hashmap return ordered string list"... Note: [Template Reference](https://hackmd.io/@akarimevatix/H1Qsmq23w) ## Worked on Items - [x] - #59 - Left, Right DS - [x] - #58 - Add SliceCommon Functions - [x] - #57 - DS hashset return ordered string list - [x] - #56 - Converters NonEmpty string, DS Join to nonempty strings - [x] - #54 -Fix method signature `func NewHashsetUsingStrings(inputArray *[]string, addCapacity int, // should be removed isMakeClone ool, // should be removed) *Hashset {` - [x] - #53 - `NewCollectionUsingStrings(stringItems *[]string, isMakeClone bool) *Collection { fix copy issue` - [x] - #52 - Apply Chmod without checking dir - [x] - #50 - Basic Map Interface like slicer - [x] - #49 - Non-interactive consts - [x] - #48 - add integrated test for chmodhelper - [x] - #45 - Write Tests for PathChmods - [x] - #44 - corestre new methods - [x] - #42 - coreinstruction ## TODOs - NA ## References - N/A ## Notes - N/A ## Performed full package - [x] Code reformat  ## Analysis CheckList - [x] Run + add screenshot of CodeInspect - [x] Run `Go Install` on root - [x] Run `go tests/test` successfully [no failing tests] - [x] Run `go run cmd/main/main.go` successfully [no build fail] See merge request !47
ExpandBySplitsPtr.go 774 B
package stringslice
import (
"strings"
"gitlab.com/evatix-go/core/constants"
)
// ExpandBySplitsPtr
// Take each slice item, split and add to the new slice array and returns it.
func ExpandBySplitsPtr(
slice *[]string,
splitters ...string,
) *[]string {
length := LengthOfPointer(slice)
if length == 0 {
return &[]string{}
}
splitExpandFunc := func(line string) *[]string {
if len(splitters) == 0 {
return &[]string{}
}
newExpandedSlice := make([]string, 0, constants.Capacity8)
for _, splitter := range splitters {
lines := strings.Split(line, splitter)
newExpandedSlice = append(newExpandedSlice, lines...)
}
return &newExpandedSlice
}
expandedSlicesOfSlice := ExpandByFunc(slice, splitExpandFunc)
return expandedSlicesOfSlice
}