feat(aa-log): add AppArmorProfile.String using a template.

This commit is contained in:
Alexandre Pujol 2023-08-17 23:11:11 +01:00
parent 4f40cb6d78
commit 574891d445
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 341 additions and 0 deletions

View file

@ -18,3 +18,14 @@ type AppArmorProfile struct {
func NewAppArmorProfile() *AppArmorProfile {
return &AppArmorProfile{}
}
// String returns the formatted representation of a profile as a string
func (p *AppArmorProfile) String() string {
var res bytes.Buffer
err := tmplAppArmorProfile.Execute(&res, p)
if err != nil {
return err.Error()
}
return res.String()
}