github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/formats/common/spdxhelpers/none_if_empty.go (about)

     1  package spdxhelpers
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  func NoneIfEmpty(value string) string {
     8  	if strings.TrimSpace(value) == "" {
     9  		return NONE
    10  	}
    11  	return value
    12  }