Created
July 5, 2020 01:40
-
-
Save codemodify/365586bbc1c93f65fbbcc785eb313243 to your computer and use it in GitHub Desktop.
go-crashproof-with-params.go
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
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