all: fix typos (#2301)

This commit is contained in:
Zhizhen He
2022-01-29 16:30:31 +08:00
committed by GitHub
parent c7e544c959
commit 9da36e461f
9 changed files with 16 additions and 87 deletions

View File

@@ -7,7 +7,7 @@ package edge
import "entgo.io/ent/schema"
// Annotation is a builtin schema annotation for
// configuring the edges behavior in codegen.
// configuring the edges' behavior in codegen.
type Annotation struct {
// The StructTag option allows overriding the struct-tag
// of the `Edges` field in the generated entity. For example:

View File

@@ -14,8 +14,8 @@ type Annotation struct {
//
// field.Annotation{
// StructTag: map[string]string{
// "id": `json:"id,omitempty" yaml:"-"`
// }
// "id": `json:"id,omitempty" yaml:"-"`,
// },
// }
//
StructTag map[string]string

View File

@@ -26,7 +26,7 @@ func String(name string) *stringBuilder {
}
// Text returns a new string field without limitation on the size.
// In MySQL, it is the "longtext" type, but in SQLite and Gremlin it has not effect.
// In MySQL, it is the "longtext" type, but in SQLite and Gremlin it has no effect.
func Text(name string) *stringBuilder {
return &stringBuilder{&Descriptor{
Name: name,
@@ -892,7 +892,7 @@ func (b *enumBuilder) GoType(ev EnumValues) *enumBuilder {
b.Values(ev.Values()...)
b.desc.goType(ev, stringType)
// If an error already exists, let that be returned instead.
// Otherwise check that the underlying type is either a string
// Otherwise, check that the underlying type is either a string
// or implements Stringer.
if b.desc.Err == nil && b.desc.Info.RType.rtype.Kind() != reflect.String && !b.desc.Info.Stringer() {
b.desc.Err = errors.New("enum values which implement ValueScanner must also implement Stringer")

View File

@@ -67,7 +67,7 @@ func (t Type) Valid() bool {
return t > TypeInvalid && t < endTypes
}
// ConstName returns the constant name of a info type.
// ConstName returns the constant name of an info type.
// It's used by entc for printing the constant name in templates.
func (t Type) ConstName() string {
switch {