Skip to content

Instantly share code, notes, and snippets.

@pulkitkumar
Created August 6, 2018 18:13
Show Gist options
  • Save pulkitkumar/6ce8db709a0406cbb0c0a025e5022c53 to your computer and use it in GitHub Desktop.
Save pulkitkumar/6ce8db709a0406cbb0c0a025e5022c53 to your computer and use it in GitHub Desktop.
GoLang Semantics
package user
import (
"io"
)
type User struct {
Name string
Email string
}
func Read(rdr io.Reader) ([]User, error) {
// read using reader u.r
// rdr.Read()
return []User{}, nil
}
func Write(wtr io.WriteCloser, u []User) error {
// write using writer
// wtr.Write()
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment