Created
September 9, 2021 16:11
-
-
Save artspb/ccfd751d86123b38da4b13ee2590f3d5 to your computer and use it in GitHub Desktop.
Example of a method call on a type.
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
package main | |
type Type struct{} | |
func (Type) foo(string) {} | |
func main() { | |
var t Type | |
t.foo("") | |
Type.foo(t, "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now I understand..... using interfaces, with this code, there's an error on line
fmt.Println(miintf.saludar("que tal"))
This is the error