Access value using key from a struct


(Andre) #21

check this example carefully https://github.com/smartmakers/drivers/blob/master/examples/golang/main.go


(Hemanth Naidu) #22

This is the package provided by smartmakers. When you create a new project and init it gives a body into which you put your developed code. In that body a library comes imported already and that is:

I try to include the both then I get this

c:\go\src\github.com\smartmakers\drivers\go\driver\driver (from $GOROOT)
C:\Go\go-work\src\gobps\src\github.com\smartmakers\drivers\go\driver\driver (from $GOPATH)

I don’t understand why they have included "github.com/smartmakers/drivers/go/driver/v1" this package when it’s not used in the original body. I have spent good amount of time in understanding their packages and how to use it, still complicated.


(Andre) #23

well, if you understand how to use that package then why would not you use it by the way showed in the example

I suppose that if you are able to run this (it works for me), then you should be able to use that package

    package main

    import (

    "github.com/smartmakers/drivers/go/driver/v1"

    )

    func main() {

    _ = v1.New()

    }