Skip to content

Instantly share code, notes, and snippets.

@dexterp
Last active April 30, 2024 08:12
Show Gist options
  • Save dexterp/392c02c09684b0aeb0828a655e02be7c to your computer and use it in GitHub Desktop.
Save dexterp/392c02c09684b0aeb0828a655e02be7c to your computer and use it in GitHub Desktop.
GO Injector
package inject
type Config struct {
}
type Inject struct {
cfg Config
}
func New(c Config) *Inject {
return &Inject{
cfg: c,
}
}
var _string *String
func (i *Inject) String() *String {
if _string != nil {
return _string
}
str := "Hello World"
_string = &str
return _string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment