Skip to content

Commit

Permalink
Merge pull request #388 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 12.77.1
  • Loading branch information
andyone authored Sep 24, 2023
2 parents f7b923f + 823d5b4 commit 45dd8da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 12.77.1

* `[options]` Fixed bug with `Split` result for empty options

### 12.77.0

* `[options]` Added merge symbol customization
Expand Down
2 changes: 1 addition & 1 deletion ek.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "12.77.0"
const VERSION = "12.77.1"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
8 changes: 7 additions & 1 deletion options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,13 @@ func (opts *Options) GetF(name string) float64 {

// Split splits mergeble option to it's values
func (opts *Options) Split(name string) []string {
return strings.Split(opts.GetS(name), MergeSymbol)
value := opts.GetS(name)

if value == "" {
return nil
}

return strings.Split(value, MergeSymbol)
}

// Is checks if option with given name has given value
Expand Down
1 change: 1 addition & 0 deletions options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (s *OptUtilSuite) TestGlobal(c *C) {
c.Assert(Is("s:string", "Test"), Equals, true)
c.Assert(Is("string1", "Test"), Equals, false)
c.Assert(Split("s:string"), DeepEquals, []string{"Test"})
c.Assert(Split("s:string1"), IsNil)
}

func (s *OptUtilSuite) TestLimiters(c *C) {
Expand Down

0 comments on commit 45dd8da

Please sign in to comment.