Created
September 4, 2022 14:47
-
-
Save donchev7/286d33671f45aa75704006289f84fe39 to your computer and use it in GitHub Desktop.
APIs with multiple parameters of the same type are hard to use correctly.
This file contains hidden or 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 Source string | |
func (src Source) CopyTo(dest string) error { | |
return CopyFile(dest, string(src)) | |
} | |
func main() { | |
var from Source = "presentation.md" | |
from.CopyTo("/tmp/backup") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment