10000 Add -mod=mod to 'go run' commands in documentation by llimllib · Pull Request #2881 · ent/ent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add -mod=mod to 'go run' commands in documentation #2881

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

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions doc/md/code-gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 <dir-path> --template glob="path/to/*.tmpl" ./ent/schema
go run -mod=mod entgo.io/ent/cmd/ent generate --template <dir-path> --template glob="path/to/*.tmpl" ./ent/schema
```

More information and examples can be found in the [external templates doc](templates.md).
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/md/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions doc/md/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,12 @@ GOPATH, setup a [Go module](https://github.com/golang/go/wiki/Modules#quick-star
go mod init <project>
```

## Installation

```console
go install entgo.io/ent/cmd/ent@latest
```

After installing `ent` codegen tool, use `go run entgo.io/ent/cmd/ent <command>` 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 `<project>/ent/schema/` directory:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/md/schema-def.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/md/traversals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/md/tutorial-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
0