-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add godoc comment to generated embed.FS
This adds a godoc comment to the generated embed.go which embeds the compiled OpenAPI specs for compilation into a Go service. Added a test to assert that the godoc comment does not interfere with the //go:embed magic comments. Fixes #120.
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
qt "github.com/frankban/quicktest" | ||
|
||
"github.com/snyk/vervet" | ||
"github.com/snyk/vervet/versionware/example/releases" | ||
) | ||
|
||
func TestEmbedding(t *testing.T) { | ||
c := qt.New(t) | ||
|
||
specs, err := vervet.LoadVersions(releases.Versions) | ||
c.Assert(err, qt.IsNil) | ||
c.Assert(specs, qt.HasLen, 3) | ||
var versions []string | ||
for i := range specs { | ||
version, err := vervet.ExtensionString(specs[i].ExtensionProps, vervet.ExtSnykApiVersion) | ||
c.Assert(err, qt.IsNil) | ||
versions = append(versions, version) | ||
} | ||
c.Assert(versions, qt.ContentEquals, []string{ | ||
"2021-11-01~experimental", | ||
"2021-11-08~experimental", | ||
"2021-11-20~experimental", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters