Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type TableOne struct {
- Id int
- name string
- date string
- }
- type TableTwo struct {
- Id int
- address string
- athome bool
- }
- func SaveMyTables(tablename string, obj *struct{ Id int }) {
- // ... Some code here
- if obj.Id != 0 {
- // ... Some code here
- }
- // ... Some code here
- }
- obj := &TableTwo{
- Id: 5
- address: "some address"
- athome: false
- }
- myPackage.Save("addresses", obj).
- cannot use obj (type *mytables.TableTwo) as type *struct { Id int } in argument to myPackage.Save
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement