From a54a580a6cc754b9ec5e7bac1b4b2d521cfb57ac Mon Sep 17 00:00:00 2001 From: Omer Preminger Date: Mon, 18 Sep 2023 11:38:22 -0400 Subject: [PATCH] drop samber/mo dependency --- LICENSE_DEPENDENCIES.md | 30 ------------------- go.mod | 1 - go.sum | 2 -- internal/pkg/util/fs/fuse/fuse_mount_linux.go | 13 ++++---- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/LICENSE_DEPENDENCIES.md b/LICENSE_DEPENDENCIES.md index ee4e6ff4b0..f6f5082038 100644 --- a/LICENSE_DEPENDENCIES.md +++ b/LICENSE_DEPENDENCIES.md @@ -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 diff --git a/go.mod b/go.mod index d1be083609..fb9d45e274 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 34413a42fa..a339388c64 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/pkg/util/fs/fuse/fuse_mount_linux.go b/internal/pkg/util/fs/fuse/fuse_mount_linux.go index b3fbfce599..10dcd51de2 100644 --- a/internal/pkg/util/fs/fuse/fuse_mount_linux.go +++ b/internal/pkg/util/fs/fuse/fuse_mount_linux.go @@ -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" @@ -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") { @@ -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 {