Skip to content

Commit

Permalink
Merge pull request #783 from raspbeep/switch-bindata-assets
Browse files Browse the repository at this point in the history
CONSOLE-3438: Switch to using assets
  • Loading branch information
openshift-merge-robot committed Aug 17, 2023
2 parents 9cea462 + b1ad590 commit 483bbcf
Show file tree
Hide file tree
Showing 33 changed files with 54 additions and 1,170 deletions.
3 changes: 0 additions & 3 deletions Makefile
Expand Up @@ -36,9 +36,6 @@ $(call build-image,ocp-console-operator,$(IMAGE_REGISTRY)/ocp/4.5:console-operat
# $3 - manifests directory
$(call add-profile-manifests,manifests,./profile-patches,./manifests)

# generate bindata targets
$(call add-bindata,assets,./bindata/...,bindata,assets,pkg/console/assets/bindata.go)

GO_TEST_PACKAGES :=./pkg/... ./cmd/...

test: test-unit test-e2e
Expand Down
24 changes: 24 additions & 0 deletions bindata/assets.go
@@ -0,0 +1,24 @@
package bindata

import (
"embed"
)

//go:embed assets/*
var f embed.FS

// Asset reads and returns the content of the named file.
func Asset(name string) ([]byte, error) {
return f.ReadFile(name)
}

// MustAsset reads and returns the content of the named file or panics
// if something went wrong.
func MustAsset(name string) []byte {
data, err := f.ReadFile(name)
if err != nil {
panic(err)
}

return data
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 483bbcf

Please sign in to comment.