Skip to content

Commit

Permalink
drop samber/mo dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Preminger committed Sep 18, 2023
1 parent 21f0f57 commit a54a580
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 40 deletions.
30 changes: 0 additions & 30 deletions LICENSE_DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14926,36 +14926,6 @@ SOFTWARE.
```


## github.com/samber/mo

**License:** MIT

```
MIT License

Copyright (c) 2022 Samuel Berthe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```


## github.com/secure-systems-lab/go-securesystemslib

**License:** MIT
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ require (
github.com/pelletier/go-toml/v2 v2.1.0
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.38.1
github.com/samber/mo v1.8.0
github.com/seccomp/libseccomp-golang v0.10.0
github.com/shopspring/decimal v1.3.1
github.com/sigstore/sigstore v1.7.3
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,6 @@ github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP
github.com/safchain/ethtool v0.3.0/go.mod h1:SA9BwrgyAqNo7M+uaL6IYbxpm5wk3L7Mm6ocLW+CJUs=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/mo v1.8.0 h1:vYjHTfg14JF9tD2NLhpoUsRi9bjyRoYwa4+do0nvbVw=
github.com/samber/mo v1.8.0/go.mod h1:BfkrCPuYzVG3ZljnZB783WIJIGk1mcZr9c9CPf8tAxs=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/seccomp/libseccomp-golang v0.10.0 h1:aA4bp+/Zzi0BnWZ2F1wgNBs5gTpm+na2rWM6M9YjLpY=
github.com/seccomp/libseccomp-golang v0.10.0/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
Expand Down
13 changes: 6 additions & 7 deletions internal/pkg/util/fs/fuse/fuse_mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"strings"

"github.com/samber/lo"
"github.com/samber/mo"
"github.com/sylabs/singularity/v4/internal/pkg/util/bin"
"github.com/sylabs/singularity/v4/pkg/image"
"github.com/sylabs/singularity/v4/pkg/sylog"
Expand Down Expand Up @@ -154,13 +153,13 @@ func (i ImageMount) generateMountOpts() ([]string, error) {

// Create a map of the extra mount options that have been requested, so we
// can catch attempts to overwrite builtin struct fields.
extraOptsMap := lo.SliceToMap(i.ExtraOpts, func(s string) (string, mo.Option[string]) {
extraOptsMap := lo.SliceToMap(i.ExtraOpts, func(s string) (string, *string) {
splitted := strings.SplitN(s, "=", 2)
if len(splitted) < 2 {
return strings.ToLower(s), mo.None[string]()
return strings.ToLower(s), nil
}

return strings.ToLower(splitted[0]), mo.Some(splitted[1])
return strings.ToLower(splitted[0]), &splitted[1]
})

if maps.HasKey(extraOptsMap, "ro") {
Expand Down Expand Up @@ -202,11 +201,11 @@ func (i ImageMount) generateMountOpts() ([]string, error) {
return opts, nil
}

func rebuildOpt(k string, v mo.Option[string]) string {
if v.IsAbsent() {
func rebuildOpt(k string, v *string) string {
if v == nil {
return k
}
return k + "=" + v.MustGet()
return k + "=" + *v
}

func (i ImageMount) GetMountPoint() string {
Expand Down

0 comments on commit a54a580

Please sign in to comment.