Skip to content

Commit

Permalink
Replace go-bindata with go:embed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmess1221 committed Mar 27, 2024
1 parent 819b9f4 commit 816c2f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 316 deletions.
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

0 comments on commit 816c2f6

Please sign in to comment.