Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace go-bindata with go:embed #143

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ validate: test
prebuild:
git config --global --add safe.directory $(shell pwd)
git status
cd / && go install github.com/go-bindata/go-bindata/...@latest
cd / && go install github.com/progrium/basht/...@latest

test: prebuild docker-image
Expand Down
315 changes: 0 additions & 315 deletions bindata.go

This file was deleted.

10 changes: 10 additions & 0 deletions plugn.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"embed"
"fmt"
"io/ioutil"
"log"
Expand All @@ -15,6 +16,15 @@ import (
var Version string
var PluginPath string

var (
//go:embed bashenv/*
fs embed.FS
)

func Asset(name string) ([]byte, error) {
return fs.ReadFile(filepath.ToSlash(name))
}

func assert(err error) {
if err != nil {
log.Fatal(err)
Expand Down