Skip to content

Commit

Permalink
Merge pull request #27 from ipfs/feat/ipfs-compat
Browse files Browse the repository at this point in the history
make it possible to pre-load this plugin into go-ipfs
  • Loading branch information
Stebalien committed Aug 15, 2019
2 parents 4d430c4 + 6075c04 commit 824440f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ go.mod: FORCE

FORCE:

s3plugin.so: plugin/main.go go.mod
s3plugin.so: plugin/main/main.go go.mod
$(GOCC) build $(GOFLAGS) -buildmode=plugin -o "$@" "$<"
chmod +x "$@"

Expand Down
11 changes: 11 additions & 0 deletions plugin/main/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
plugin "github.com/ipfs/go-ds-s3/plugin"
)

var Plugins = plugin.Plugins //nolint

func main() {
panic("this is a plugin, build it as a plugin, this is here as for go#20312")
}
5 changes: 1 addition & 4 deletions plugin/main.go → plugin/s3ds.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package plugin

import (
"fmt"
Expand All @@ -13,9 +13,6 @@ var Plugins = []plugin.Plugin{
&S3Plugin{},
}

// Mark this as used and exported. "nolint" doesn't work.
var _ = Plugins

type S3Plugin struct{}

func (s3p S3Plugin) Name() string {
Expand Down

0 comments on commit 824440f

Please sign in to comment.