dosubot[bot] commented on issue #362:
URL: 
https://github.com/apache/incubator-hugegraph-doc/issues/362#issuecomment-2151696398

   <!-- Answer -->
   It appears there was a misunderstanding regarding the import paths. The 
correct import path for the HugeGraph client in Go should be:
   
   ```go
   import (
       
"github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go/hugegraph"
       
"github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go/hugegraph/model"
   )
   ```
   
   Ensure your `go.mod` file includes the correct module path:
   
   ```go
   module your-module-name
   
   go 1.16
   
   require (
       github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go 
v1.2.0
   )
   ```
   
   Then, run `go get` to fetch the package:
   
   ```sh
   go get github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go
   ```
   
   Here is an example of how to use the HugeGraph client in your Go code:
   
   ```go
   package main
   
   import (
       "log"
       
"github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go/hugegraph"
       
"github.com/apache/incubator-hugegraph-toolchain/hugegraph-client-go/hugegraph/model"
   )
   
   func main() {
       // Create a new vertex
       vertex := model.Vertex{
           // Initialize vertex fields here
       }
   
       // Use the vertex in the client call
       client, err := hugegraph.NewClient("http://your-hugegraph-server";, 
"hugegraph")
       if err != nil {
           log.Fatalf("Failed to create client: %v", err)
       }
       defer client.Close()
   
       client.Vertex.Create.WithVertex(vertex)
   }
   ```
   
   Make sure to replace `"http://your-hugegraph-server"` with the actual URL of 
your HugeGraph server and initialize the `vertex` fields as required 
<sup>[[1]](https://github.com/apache/incubator-hugegraph-doc/blob/master/static/client-go/index.html)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/quickstart/hugegraph-client.md)</sup><sup>[[3]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/cn/docs/quickstart/hugegraph-client.md)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to