-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load extensions during compile time using go build tags
- Loading branch information
1 parent
8fd3d74
commit a2cc5ad
Showing
15 changed files
with
645 additions
and
175 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package extensions | ||
|
||
import "strings" | ||
|
||
var registeredExtensions = make(map[string]*Extension) | ||
|
||
func RegisterExtension(name string, ext *Extension) error { | ||
name = strings.ToLower(name) | ||
if _, ok := registeredExtensions[name]; ok { | ||
panic("extension of same name already registered: " + name) | ||
} | ||
|
||
registeredExtensions[name] = ext | ||
return nil | ||
} | ||
|
||
func GetRegisteredExtensions() map[string]*Extension { | ||
return registeredExtensions | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.