Skip to content

Instantly share code, notes, and snippets.

@codemodify
Created July 5, 2020 01:40
Show Gist options
  • Save codemodify/365586bbc1c93f65fbbcc785eb313243 to your computer and use it in GitHub Desktop.
Save codemodify/365586bbc1c93f65fbbcc785eb313243 to your computer and use it in GitHub Desktop.
go-crashproof-with-params.go
type MyType interface {
DoSomething()
}
crashproof.GoWithArgs(func(args ...interface{}) {
if p, ok := args[0].(MyType); ok {
p.DoSomething()
}
}, myTypeInstance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment