mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
Internalize majority of cmd package (#2533)
* internalize majority of cmd package and migrate integration tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add internal api encoder Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * create internal representation of all formats Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * export capability to get default encoders Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * restore test fixtures Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package options
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/anchore/clio"
|
||||
"github.com/anchore/syft/internal/redact"
|
||||
)
|
||||
|
||||
type secret string
|
||||
|
||||
var _ interface {
|
||||
fmt.Stringer
|
||||
clio.PostLoader
|
||||
} = (*secret)(nil)
|
||||
|
||||
// PostLoad needs to use a pointer receiver, even if it's not modifying the value
|
||||
func (r *secret) PostLoad() error {
|
||||
redact.Add(string(*r))
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r secret) String() string {
|
||||
return string(r)
|
||||
}
|
||||
Reference in New Issue
Block a user