diff --git a/doc/md/code-gen.md b/doc/md/code-gen.md index 0871ba3360..8400b3f011 100755 --- a/doc/md/code-gen.md +++ b/doc/md/code-gen.md @@ -17,7 +17,7 @@ go get -d entgo.io/ent/cmd/ent In order to generate one or more schema templates, run `ent init` as follows: ```bash -go run entgo.io/ent/cmd/ent init User Pet +go run -mod=mod entgo.io/ent/cmd/ent init User Pet ``` `init` will create the 2 schemas (`user.go` and `pet.go`) under the `ent/schema` directory. @@ -110,7 +110,7 @@ a file with the same name as the template. The flag format supports `file`, `di as follows: ```console -go run entgo.io/ent/cmd/ent generate --template --template glob="path/to/*.tmpl" ./ent/schema +go run -mod=mod entgo.io/ent/cmd/ent generate --template --template glob="path/to/*.tmpl" ./ent/schema ``` More information and examples can be found in the [external templates doc](templates.md). @@ -153,7 +153,7 @@ The full example exists in [GitHub](https://github.com/ent/ent/tree/master/examp In order to get a description of your graph schema, run: ```bash -go run entgo.io/ent/cmd/ent describe ./ent/schema +go run -mod=mod entgo.io/ent/cmd/ent describe ./ent/schema ``` An example for the output is as follows: diff --git a/doc/md/features.md b/doc/md/features.md index 6692db6a66..7a2a02944a 100644 --- a/doc/md/features.md +++ b/doc/md/features.md @@ -13,7 +13,7 @@ Feature flags can be provided either by CLI flags or as arguments to the `gen` p #### CLI ```console -go run entgo.io/ent/cmd/ent generate --feature privacy,entql ./ent/schema +go run -mod=mod entgo.io/ent/cmd/ent generate --feature privacy,entql ./ent/schema ``` #### Go diff --git a/doc/md/getting-started.md b/doc/md/getting-started.md index c1bc9df748..4058ee8f9c 100755 --- a/doc/md/getting-started.md +++ b/doc/md/getting-started.md @@ -27,21 +27,12 @@ GOPATH, setup a [Go module](https://github.com/golang/go/wiki/Modules#quick-star go mod init ``` -## Installation - -```console -go install entgo.io/ent/cmd/ent@latest -``` - -After installing `ent` codegen tool, use `go run entgo.io/ent/cmd/ent ` to execute -commands. - ## Create Your First Schema Go to the root directory of your project, and run: ```console -go run entgo.io/ent/cmd/ent init User +go run -mod=mod entgo.io/ent/cmd/ent init User ``` The command above will generate the schema for `User` under `/ent/schema/` directory: @@ -272,7 +263,7 @@ Let's create 2 additional entities named `Car` and `Group` with a few fields. We to generate the initial schemas: ```console -go run entgo.io/ent/cmd/ent init Car Group +go run -mod=mod entgo.io/ent/cmd/ent init Car Group ``` And then we add the rest of the fields manually: diff --git a/doc/md/schema-def.md b/doc/md/schema-def.md index 061a93f1e5..9e6f7c3d71 100755 --- a/doc/md/schema-def.md +++ b/doc/md/schema-def.md @@ -55,7 +55,7 @@ Entity schemas are usually stored inside `ent/schema` directory under the root directory of your project, and can be generated by `entc` as follows: ```console -go run entgo.io/ent/cmd/ent init User Group +go run -mod=mod entgo.io/ent/cmd/ent init User Group ``` :::note diff --git a/doc/md/traversals.md b/doc/md/traversals.md index d184202ea1..ac83834bd3 100755 --- a/doc/md/traversals.md +++ b/doc/md/traversals.md @@ -11,7 +11,7 @@ For the purpose of the example, we'll generate the following graph: The first step is to generate the 3 schemas: `Pet`, `User`, `Group`. ```console -go run entgo.io/ent/cmd/ent init Pet User Group +go run -mod=mod entgo.io/ent/cmd/ent init Pet User Group ``` Add the necessary fields and edges for the schemas: diff --git a/doc/md/tutorial-setup.md b/doc/md/tutorial-setup.md index 70d610b174..0d00067bcd 100755 --- a/doc/md/tutorial-setup.md +++ b/doc/md/tutorial-setup.md @@ -29,7 +29,7 @@ go get -d entgo.io/ent/cmd/ent ``` ```console -go run entgo.io/ent/cmd/ent init Todo +go run -mod=mod entgo.io/ent/cmd/ent init Todo ``` After installing Ent and running `ent init`, your project directory should look like this: