Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated incorrect installation URL in Analytics-Go documentation #7522

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ All of Segment's server-side libraries are built for high-performance, so you ca
Install `analytics-go` using `go get`:

```bash
go get gopkg.in/segmentio/analytics-go.v3
go get github.com/segmentio/analytics-go/v3
```

Then import it and initialize an instance with your source's **Write Key**. Of course, you'll want to replace `YOUR_WRITE_KEY` with your actual **Write Key** which you can find in Segment under your source settings.

```go
package main

import "gopkg.in/segmentio/analytics-go.v3"
import "github.com/segmentio/analytics-go/v3"

func main() {
client := analytics.New("YOUR_WRITE_KEY")
Expand Down Expand Up @@ -414,8 +414,6 @@ for example, with [govendor](https://github.com/kardianos/govendor){:target="_bl
govendor fetch github.com/segmentio/analytics-go@v3.0
```

Alternatively, you can also use [`gopkg.in`](http://labix.org/gopkg.in){:target="_blank”}. First run `go get gopkg.in/segmentio/analytics-go.v3` and replace your imports with `import "gopkg.in/segmentio/analytics-go.v3"`.

To help with migrating your code, Segment recommends checking out a simple example that is written in [v2](https://github.com/segmentio/analytics-go/blob/v2.0/examples/track.go) and [v3](https://github.com/segmentio/analytics-go/blob/v3.0/examples/track.go) so you can easily see the differences.

The first difference you'll notice is that `Client` is now an interface. It has a single method - `Enqueue` that can accept messages of all types.
Expand Down
Loading