Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 12.77.1 #388

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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