Skip to content

Commit

Permalink
Rename Go modules to go.k6.io
Browse files Browse the repository at this point in the history
Part of #1921
  • Loading branch information
Ivan Mirić committed May 10, 2021
1 parent baa5a8a commit caf5f64
Show file tree
Hide file tree
Showing 213 changed files with 606 additions and 607 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -43,15 +43,15 @@ To get a basic development environment for Go and k6 up and running, first make

Once that's done, you can get the k6 source into your Go workspace (`$GOPATH/src`) by running:
```bash
go get github.com/loadimpact/k6
go get go.k6.io/k6
```
This will also build a `k6` binary and put it in `$GOPATH/bin`.

**Building from source**:

Standing in the repo root (`$GOPATH/src/github.com/loadimpact/k6`) you can build a k6 binary from source by running:
Standing in the repo root (`$GOPATH/src/go.k6.io/k6`) you can build a k6 binary from source by running:
```bash
cd $GOPATH/src/github.com/loadimpact/k6
cd $GOPATH/src/go.k6.io/k6
go build
```

Expand Down Expand Up @@ -81,7 +81,7 @@ go test -race ./...

To run the tests of a specific package:
```bash
go test -race github.com/loadimpact/k6/core
go test -race go.k6.io/k6/core
```

To run just a specific test case use `-run` and pass in a regex that matches the name of the test:
Expand All @@ -91,7 +91,7 @@ go test -race ./... -run ^TestEngineRun$

Combining the two above we can run a specific test case in a specific package:
```bash
go test -race github.com/loadimpact/k6/core -run ^TestEngineRun$
go test -race go.k6.io/k6/core -run ^TestEngineRun$
```

Style guide
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,8 +1,8 @@
FROM golang:1.16-alpine as builder
WORKDIR $GOPATH/src/github.com/loadimpact/k6
WORKDIR $GOPATH/src/go.k6.io/k6
ADD . .
RUN apk --no-cache add git
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X github.com/loadimpact/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X go.k6.io/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"

FROM alpine:3.13
RUN apk add --no-cache ca-certificates && \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -139,8 +139,8 @@ If there isn't an official package for your operating system or architecture, or

k6 is written in Go, so it's just a single statically-linked executable and very easy to build and distribute. To build from source you need **[Git](https://git-scm.com/downloads)** and **[Go](https://golang.org/doc/install)** (1.12 or newer). Follow these instructions:

- Run `go get github.com/loadimpact/k6` which will:
- git clone the repo and put the source in `$GOPATH/src/github.com/loadimpact/k6`
- Run `go get go.k6.io/k6` which will:
- git clone the repo and put the source in `$GOPATH/src/go.k6.io/k6`
- build a `k6` binary and put it in `$GOPATH/bin`
- Make sure you have `$GOPATH/bin` in your `PATH` (or copy the `k6` binary somewhere in your `PATH`), so you are able to run k6 from any location.
- Tada, you can now run k6 using `k6 run script.js`
Expand Down
2 changes: 1 addition & 1 deletion api/common/context.go
Expand Up @@ -23,7 +23,7 @@ package common
import (
"context"

"github.com/loadimpact/k6/core"
"go.k6.io/k6/core"
)

type ContextKey int
Expand Down
6 changes: 3 additions & 3 deletions api/server.go
Expand Up @@ -26,9 +26,9 @@ import (

"github.com/sirupsen/logrus"

"github.com/loadimpact/k6/api/common"
v1 "github.com/loadimpact/k6/api/v1"
"github.com/loadimpact/k6/core"
"go.k6.io/k6/api/common"
v1 "go.k6.io/k6/api/v1"
"go.k6.io/k6/core"
)

func newHandler(logger logrus.FieldLogger) http.Handler {
Expand Down
12 changes: 6 additions & 6 deletions api/server_test.go
Expand Up @@ -31,12 +31,12 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/loadimpact/k6/api/common"
"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/core/local"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/testutils/minirunner"
"go.k6.io/k6/api/common"
"go.k6.io/k6/core"
"go.k6.io/k6/core/local"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/testutils/minirunner"
)

func testHTTPHandler(rw http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/client/client.go
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/manyminds/api2go/jsonapi"
"github.com/sirupsen/logrus"

"github.com/loadimpact/k6/api/v1"
"go.k6.io/k6/api/v1"
)

// Client is a simple HTTP client for the REST API.
Expand Down
2 changes: 1 addition & 1 deletion api/v1/client/metrics.go
Expand Up @@ -24,7 +24,7 @@ import (
"context"
"net/url"

v1 "github.com/loadimpact/k6/api/v1"
v1 "go.k6.io/k6/api/v1"
)

// Metrics returns the current metrics summary.
Expand Down
2 changes: 1 addition & 1 deletion api/v1/client/status.go
Expand Up @@ -24,7 +24,7 @@ import (
"context"
"net/url"

v1 "github.com/loadimpact/k6/api/v1"
v1 "go.k6.io/k6/api/v1"
)

// Status returns the current k6 status.
Expand Down
2 changes: 1 addition & 1 deletion api/v1/group.go
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/manyminds/api2go/jsonapi"

"github.com/loadimpact/k6/lib"
"go.k6.io/k6/lib"
)

type Check struct {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/group_routes.go
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/manyminds/api2go/jsonapi"

"github.com/loadimpact/k6/api/common"
"go.k6.io/k6/api/common"
)

func handleGetGroups(rw http.ResponseWriter, r *http.Request) {
Expand Down
10 changes: 5 additions & 5 deletions api/v1/group_routes_test.go
Expand Up @@ -31,11 +31,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/core/local"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/testutils/minirunner"
"go.k6.io/k6/core"
"go.k6.io/k6/core/local"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/testutils/minirunner"
)

func TestGetGroups(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/group_test.go
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/loadimpact/k6/lib"
"go.k6.io/k6/lib"
)

func TestNewCheck(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/metric.go
Expand Up @@ -27,7 +27,7 @@ import (

"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/stats"
"go.k6.io/k6/stats"
)

type NullMetricType struct {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/metric_routes.go
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/manyminds/api2go/jsonapi"

"github.com/loadimpact/k6/api/common"
"go.k6.io/k6/api/common"
)

func handleGetMetrics(rw http.ResponseWriter, r *http.Request) {
Expand Down
12 changes: 6 additions & 6 deletions api/v1/metric_routes_test.go
Expand Up @@ -32,12 +32,12 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/core/local"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/testutils/minirunner"
"github.com/loadimpact/k6/stats"
"go.k6.io/k6/core"
"go.k6.io/k6/core/local"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/testutils/minirunner"
"go.k6.io/k6/stats"
)

func TestGetMetrics(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/metric_test.go
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/stretchr/testify/assert"
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/stats"
"go.k6.io/k6/stats"
)

func TestNullMetricTypeJSON(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/v1/routes_test.go
Expand Up @@ -28,8 +28,8 @@ import (

"github.com/stretchr/testify/assert"

"github.com/loadimpact/k6/api/common"
"github.com/loadimpact/k6/core"
"go.k6.io/k6/api/common"
"go.k6.io/k6/core"
)

func newRequestWithEngine(engine *core.Engine, method, target string, body io.Reader) *http.Request {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/setup_teardown_routes.go
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/manyminds/api2go/jsonapi"

"github.com/loadimpact/k6/api/common"
"go.k6.io/k6/api/common"
)

// NullSetupData is wrapper around null to satisfy jsonapi
Expand Down
14 changes: 7 additions & 7 deletions api/v1/setup_teardown_routes_test.go
Expand Up @@ -36,13 +36,13 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/core/local"
"github.com/loadimpact/k6/js"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/types"
"github.com/loadimpact/k6/loader"
"go.k6.io/k6/core"
"go.k6.io/k6/core/local"
"go.k6.io/k6/js"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/types"
"go.k6.io/k6/loader"
)

func TestSetupData(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/v1/status.go
Expand Up @@ -23,8 +23,8 @@ package v1
import (
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/lib"
"go.k6.io/k6/core"
"go.k6.io/k6/lib"
)

type Status struct {
Expand Down
6 changes: 3 additions & 3 deletions api/v1/status_routes.go
Expand Up @@ -27,9 +27,9 @@ import (

"github.com/manyminds/api2go/jsonapi"

"github.com/loadimpact/k6/api/common"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/executor"
"go.k6.io/k6/api/common"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/executor"
)

func handleGetStatus(rw http.ResponseWriter, r *http.Request) {
Expand Down
10 changes: 5 additions & 5 deletions api/v1/status_routes_test.go
Expand Up @@ -35,11 +35,11 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/core"
"github.com/loadimpact/k6/core/local"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/testutils/minirunner"
"go.k6.io/k6/core"
"go.k6.io/k6/core/local"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/testutils/minirunner"
)

func TestGetStatus(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion build-release.sh
Expand Up @@ -19,7 +19,7 @@ build() {
local BUILD_ARGS=(-o "${OUT_DIR}/${NAME}/k6${SUFFIX}" -trimpath)

if [ -n "$VERSION_DETAILS" ]; then
BUILD_ARGS+=(-ldflags "-X github.com/loadimpact/k6/lib/consts.VersionDetails=$VERSION_DETAILS")
BUILD_ARGS+=(-ldflags "-X go.k6.io/k6/lib/consts.VersionDetails=$VERSION_DETAILS")
fi

echo "- Building platform: ${ALIAS} (" "${BUILD_ENV[@]}" "go build" "${BUILD_ARGS[@]}" ")"
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/api.go
Expand Up @@ -27,7 +27,7 @@ import (
"net/http"
"strconv"

"github.com/loadimpact/k6/lib"
"go.k6.io/k6/lib"
)

type ResultStatus int
Expand Down
4 changes: 2 additions & 2 deletions cloudapi/api_test.go
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/loadimpact/k6/lib/testutils"
"github.com/loadimpact/k6/lib/types"
"go.k6.io/k6/lib/testutils"
"go.k6.io/k6/lib/types"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/config.go
Expand Up @@ -27,7 +27,7 @@ import (
"gopkg.in/guregu/null.v3"

"github.com/kelseyhightower/envconfig"
"github.com/loadimpact/k6/lib/types"
"go.k6.io/k6/lib/types"
)

// Config holds all the necessary data and options for sending metrics to the Load Impact cloud.
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/config_test.go
Expand Up @@ -23,7 +23,7 @@ import (
"testing"
"time"

"github.com/loadimpact/k6/lib/types"
"go.k6.io/k6/lib/types"
"github.com/stretchr/testify/assert"
"gopkg.in/guregu/null.v3"
)
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/logs_test.go
Expand Up @@ -25,7 +25,7 @@ import (
"testing"
"time"

"github.com/loadimpact/k6/lib/testutils"
"go.k6.io/k6/lib/testutils"
"github.com/mailru/easyjson"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion cmd/archive.go
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/loadimpact/k6/loader"
"go.k6.io/k6/loader"
)

var archiveOut = "archive.tar"
Expand Down
12 changes: 6 additions & 6 deletions cmd/cloud.go
Expand Up @@ -39,12 +39,12 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/loadimpact/k6/cloudapi"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/lib/consts"
"github.com/loadimpact/k6/loader"
"github.com/loadimpact/k6/ui"
"github.com/loadimpact/k6/ui/pb"
"go.k6.io/k6/cloudapi"
"go.k6.io/k6/lib"
"go.k6.io/k6/lib/consts"
"go.k6.io/k6/loader"
"go.k6.io/k6/ui"
"go.k6.io/k6/ui/pb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/common.go
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/spf13/pflag"
"gopkg.in/guregu/null.v3"

"github.com/loadimpact/k6/lib/types"
"go.k6.io/k6/lib/types"
)

// Use these when interacting with fs and writing to terminal, makes a command testable
Expand Down

0 comments on commit caf5f64

Please sign in to comment.