Closed jghiloni closed 2 years ago
I don't believe that path
is part of the spec for buildpack.toml
. My understanding is that libcnb adds this field so an author knows where the buildpack resides. I think we should just omit that field altogether if we're reading or writing a buildpack.toml.
That sounds good -- I'll add another commit changing that behavior
Most Go applications use
github.com/burntsushi/toml
as their toml parsing library. When struct tags are omitted, the library will do case-insensitive deserialization, so a property calledpath
will successfully unmarshal into thePath
struct field.However, if youmarshal a Buildpack instance to toml, the
Path
field appears regardless of whether it is set or not, and technically violates the buildpack toml spec. This PR adds a struct tag to not only marshal the field to thepath
property in the resultant toml, but also adds theomitempty
modifier to ignore the field altogether when not set.This resolves #85
Signed-off-by: Josh Ghiloni jghiloni@vmware.com