mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
all: fix typos (#2301)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user