-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes from statik to go:embed for examples serving
There's currently a glitch because go.mod isn't allowed in the go:embed path. Fixes #126 See golang/go#41191 (comment)
- Loading branch information
Adrian Cole
committed
Mar 24, 2021
1 parent
5d8ef0e
commit cd4c268
Showing
22 changed files
with
51 additions
and
143 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
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 |
---|---|---|
|
@@ -2,6 +2,4 @@ vendor | |
dist | ||
/getenvoy | ||
/build/ | ||
|
||
# code generated by `github.com/rakyll/statik` | ||
statik.go | ||
.idea |
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
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,23 @@ | ||
package init | ||
// ^^ last path in the directory relative from the project root data/extension/init | ||
|
||
import ( | ||
"embed" | ||
"io/fs" | ||
) | ||
|
||
// templatesFs includes only the relative path of "templates". | ||
// | ||
// Assets must be in this directory because go:embed doesn't support navigation outside (ex. ../) | ||
// See https://pkg.go.dev/embed#hdr-Directives | ||
//go:embed templates/* | ||
var templatesFs embed.FS | ||
|
||
// GetTemplates returns the templates directory as a filesystem | ||
func GetTemplates() fs.FS { | ||
fs, err := fs.Sub(templatesFs, "templates") | ||
if err != nil { | ||
panic(err) // unexpected or a typo | ||
} | ||
return fs | ||
} |
8 changes: 0 additions & 8 deletions
8
data/extension/init/templates/tinygo/envoy.access_loggers/default/go.mod
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
data/extension/init/templates/tinygo/envoy.access_loggers/default/go.sum
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
data/extension/init/templates/tinygo/envoy.access_loggers/default/main.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package init | ||
|
||
import ( | ||
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm" | ||
|
8 changes: 0 additions & 8 deletions
8
data/extension/init/templates/tinygo/envoy.filters.http/default/go.mod
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
data/extension/init/templates/tinygo/envoy.filters.http/default/go.sum
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
data/extension/init/templates/tinygo/envoy.filters.http/default/main.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package init | ||
|
||
import ( | ||
"bufio" | ||
|
2 changes: 1 addition & 1 deletion
2
data/extension/init/templates/tinygo/envoy.filters.http/default/main_test.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package init | ||
|
||
import ( | ||
"testing" | ||
|
8 changes: 0 additions & 8 deletions
8
data/extension/init/templates/tinygo/envoy.filters.network/default/go.mod
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
data/extension/init/templates/tinygo/envoy.filters.network/default/go.sum
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
data/extension/init/templates/tinygo/envoy.filters.network/default/main.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package init | ||
|
||
import ( | ||
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm" | ||
|
2 changes: 1 addition & 1 deletion
2
data/extension/init/templates/tinygo/envoy.filters.network/default/main_test.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package init | ||
|
||
import ( | ||
"testing" | ||
|
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
Oops, something went wrong.