From 0630c8c98b56c39453456581045290294d5aaad3 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Mon, 10 Jun 2024 09:14:00 +1000 Subject: [PATCH] feat: refactor --- metadata/decode.go | 2 +- metadata/doc.go | 2 ++ metadata/metadata.go | 2 +- metadata/providers/cached/doc.go | 5 ++--- metadata/providers/memory/doc.go | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 metadata/doc.go diff --git a/metadata/decode.go b/metadata/decode.go index f290012b..896e4175 100644 --- a/metadata/decode.go +++ b/metadata/decode.go @@ -74,7 +74,7 @@ func (d *Decoder) Parse(payload *PayloadJSON) (metadata *Metadata, err error) { } if n := len(metadata.Unparsed); n != 0 && !d.ignoreEntryParsingErrors { - return metadata, fmt.Errorf("error occured parsing metadata: %d entries had errors during parsing", n) + return metadata, fmt.Errorf("error occurred parsing metadata: %d entries had errors during parsing", n) } return metadata, nil diff --git a/metadata/doc.go b/metadata/doc.go new file mode 100644 index 00000000..7db8c71d --- /dev/null +++ b/metadata/doc.go @@ -0,0 +1,2 @@ +// Package metadata handles metadata validation instrumentation. +package metadata diff --git a/metadata/metadata.go b/metadata/metadata.go index 58dfb4bb..194a6fed 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -368,7 +368,7 @@ func (j StatementJSON) Parse() (statement Statement, err error) { if len(j.AaGUID) != 0 { if aaguid, err = uuid.Parse(j.AaGUID); err != nil { - return statement, fmt.Errorf("error occurred parsing statement with description '%s': error occured parsing AAGUID value: %w", j.Description, err) + return statement, fmt.Errorf("error occurred parsing statement with description '%s': error occurred parsing AAGUID value: %w", j.Description, err) } } diff --git a/metadata/providers/cached/doc.go b/metadata/providers/cached/doc.go index ca370b45..cb18e914 100644 --- a/metadata/providers/cached/doc.go +++ b/metadata/providers/cached/doc.go @@ -1,9 +1,8 @@ -package cached - -// The cached package handles a metadata.Provider implementation that both downloads and caches the MDS3 blob. This +// Package cached handles a metadata.Provider implementation that both downloads and caches the MDS3 blob. This // effectively is the recommended provider in most instances as it's fairly robust. Alternatively we suggest // implementing a similar provider that leverages the memory.Provider as an underlying element. // // This provider only specifically performs updates at the time it's initialized. It has no automatic update // functionality. This may change in the future however if you want this functionality at this time we recommend making // your own implementation. +package cached diff --git a/metadata/providers/memory/doc.go b/metadata/providers/memory/doc.go index 95c077d4..bc2679f6 100644 --- a/metadata/providers/memory/doc.go +++ b/metadata/providers/memory/doc.go @@ -1,5 +1,4 @@ -package memory - -// The memory package handles a metadata.Provider implementation that solely exists in memory. It's intended as a basis +// Package memory handles a metadata.Provider implementation that solely exists in memory. It's intended as a basis // for other providers and generally not recommended to use directly unless you're implementing your own logic to handle // the download and potential caching of the MDS3 blob yourself. +package memory