diff --git a/dialect/sql/builder.go b/dialect/sql/builder.go index 36b23dd7e..f07d52d11 100644 --- a/dialect/sql/builder.go +++ b/dialect/sql/builder.go @@ -225,7 +225,7 @@ func (t *TableAlter) AddColumn(c *ColumnBuilder) *TableAlter { return t } -// Modify appends the `MODIFY/ALTER COLUMN` clause to the given `ALTER TABLE` statement. +// ModifyColumn appends the `MODIFY/ALTER COLUMN` clause to the given `ALTER TABLE` statement. func (t *TableAlter) ModifyColumn(c *ColumnBuilder) *TableAlter { switch { case t.postgres(): diff --git a/entc/entc.go b/entc/entc.go index 5c2eb8638..e5ac82022 100644 --- a/entc/entc.go +++ b/entc/entc.go @@ -4,7 +4,6 @@ // Package entc provides an interface for interacting with // entc (ent codegen) as a package rather than an executable. - package entc import ( diff --git a/entc/gen/type.go b/entc/gen/type.go index 84e81cfed..83e4b1751 100644 --- a/entc/gen/type.go +++ b/entc/gen/type.go @@ -373,7 +373,7 @@ func (t Type) Describe(w io.Writer) { io.WriteString(w, strings.ReplaceAll(b.String(), "\n", "\n\t")+"\n") } -// NewIndex adds a new index for the given type table. +// AddIndex adds a new index for the type. // It fails if the schema index is invalid. func (t *Type) AddIndex(idx *load.Index) error { index := &Index{Unique: idx.Unique} diff --git a/entc/load/load.go b/entc/load/load.go index 1eae8336a..ec66bd89f 100644 --- a/entc/load/load.go +++ b/entc/load/load.go @@ -50,7 +50,7 @@ type Config struct { Names []string } -// Build loads the schemas package and build the Go plugin with this info. +// Load loads the schemas package and build the Go plugin with this info. func (c *Config) Load() (*SchemaSpec, error) { pkgPath, err := c.load() if err != nil { diff --git a/schema/field/type.go b/schema/field/type.go index 4b6de8365..42136b164 100644 --- a/schema/field/type.go +++ b/schema/field/type.go @@ -6,8 +6,10 @@ package field import "strings" +// A Type represents a field type. type Type uint8 +// List of field types. const ( TypeInvalid Type = iota TypeBool @@ -62,6 +64,8 @@ func (t Type) ConstName() string { } } +// TypeInfo holds the information regarding field type. +// Used by complex types like JSON and Bytes. type TypeInfo struct { Type Type Ident string