Skip to content

Commit f61b485

Browse files
committed
cleaned up the output generation code
1 parent b488859 commit f61b485

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmd/amass/io.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,24 @@ func NewOutput(ctx context.Context, g *netmap.Graph, e *enum.Enumeration, filter
3232
}
3333

3434
var assets []*types.Asset
35+
qtime := e.Config.CollectionStartTime.UTC()
3536
for _, atype := range []oam.AssetType{oam.FQDN, oam.IPAddress, oam.Netblock, oam.ASN, oam.RIROrg} {
36-
if a, err := g.DB.FindByType(atype, e.Config.CollectionStartTime.UTC()); err == nil {
37+
if a, err := g.DB.FindByType(atype, qtime); err == nil {
3738
assets = append(assets, a...)
3839
}
3940
}
4041

4142
for _, from := range assets {
42-
fromstr := extractAssetName(from, e.Config.CollectionStartTime.UTC())
43+
fromstr := extractAssetName(from, qtime)
4344

44-
if rels, err := g.DB.OutgoingRelations(from, e.Config.CollectionStartTime.UTC()); err == nil {
45+
if rels, err := g.DB.OutgoingRelations(from, qtime); err == nil {
4546
for _, rel := range rels {
4647
lineid := from.ID + rel.ID + rel.ToAsset.ID
4748
if filter.Has(lineid) {
4849
continue
4950
}
50-
if to, err := g.DB.FindById(rel.ToAsset.ID, e.Config.CollectionStartTime.UTC()); err == nil {
51-
tostr := extractAssetName(to, e.Config.CollectionStartTime.UTC())
51+
if to, err := g.DB.FindById(rel.ToAsset.ID, qtime); err == nil {
52+
tostr := extractAssetName(to, qtime)
5253

5354
output = append(output, fmt.Sprintf("%s %s %s %s %s", fromstr, "-->", magenta(rel.Type), "-->", tostr))
5455
filter.Insert(lineid)

0 commit comments

Comments
 (0)