Skip to content

Commit

Permalink
cleanup old code
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshnoronha committed Oct 2, 2024
1 parent 1fa8f14 commit 0f5f7c0
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 342 deletions.
1 change: 0 additions & 1 deletion cmd/dt.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Basic Example:
dtParams.PopulateInputField(ctx)

assembleParams, err := extractArgsFromDTtoAssemble(dtParams)
fmt.Println("assemble.Input: ", assembleParams.Input)
if err != nil {
return err
}
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/google/go-github/v52 v52.0.0
github.com/google/uuid v1.6.0
github.com/mitchellh/copystructure v1.2.0
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/pingcap/log v1.1.0
github.com/samber/lo v1.47.0
github.com/spdx/tools-golang v0.5.5
Expand All @@ -27,21 +26,17 @@ require (
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spdx/gordf v0.0.0-20221230105357-b735bd5aac89 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.9.0
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pingcap/errors v0.11.0 h1:DCJQB8jrHbQ1VVlMFIrbj2ApScNNotVmkSNplu2yUt4=
Expand Down
8 changes: 1 addition & 7 deletions pkg/assemble/cdx/comp_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import (
"github.com/interlynk-io/sbomasm/pkg/logger"
)

type item struct {
comp *cydx.Component
oldID string
newID string
}

type idmap struct {
oldID string
newID string
Expand Down Expand Up @@ -57,7 +51,7 @@ func (s *ComponentService) StoreAndCloneWithNewID(c *cydx.Component) *cydx.Compo
panic(err)
}

newID := newBomRef(nc)
newID := newBomRef()
nc.BOMRef = newID

s.idList = append(s.idList, idmap{
Expand Down
16 changes: 2 additions & 14 deletions pkg/assemble/cdx/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ type MergeSettings struct {
}

func Merge(ms *MergeSettings) error {
merger := newMerge(ms)

merger.loadBoms()
merger.initOutBom()

if len(ms.Output.Spec) > 0 && ms.Output.Spec != "cyclonedx" {
return errors.New("invalid output spec")
}
Expand All @@ -144,13 +139,6 @@ func Merge(ms *MergeSettings) error {
return errors.New("invalid CycloneDX spec version")
}

if ms.Assemble.FlatMerge {
return merger.flatMerge()
} else if ms.Assemble.HierarchicalMerge {
return merger.hierarchicalMerge()
} else if ms.Assemble.AssemblyMerge {
return merger.assemblyMerge()
}

return merger.hierarchicalMerge()
merger := newMerge(ms)
return merger.combinedMerge()
}
Loading

0 comments on commit 0f5f7c0

Please sign in to comment.