mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: fix grammar and language usage in function comments (#1126)
* fix grammar and english usage in templates * bindata gen * codegen * go generate ./again...
This commit is contained in:
committed by
GitHub
parent
7afc24826b
commit
b8b82f80a4
@@ -140,7 +140,7 @@ func ({{ $receiver }} *{{ $builder }}) Save(ctx context.Context) ([]*{{ $.Name }
|
||||
return nodes, nil
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func ({{ $receiver }} *{{ $builder }}) SaveX(ctx context.Context) []*{{ $.Name }} {
|
||||
v, err := {{ $receiver }}.Save(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -27,7 +27,7 @@ func isSQLConstraintError(err error) (*ConstraintError, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred.
|
||||
// rollback calls tx.Rollback and wraps the given error with the rollback error if present.
|
||||
func rollback(tx dialect.Tx, err error) error {
|
||||
if rerr := tx.Rollback(); rerr != nil {
|
||||
err = fmt.Errorf("%s: %v", err.Error(), rerr)
|
||||
|
||||
@@ -8,7 +8,7 @@ in the LICENSE file in the root directory of this source tree.
|
||||
{{ define "dialect/sql/meta/constants" }}
|
||||
{{- range $t := $.RelatedTypes }}
|
||||
{{- if ne $t.ID.StorageKey $.ID.StorageKey }}
|
||||
// {{ $t.Name }}FieldID holds the string denoting the id field of the {{ $t.Name }}.
|
||||
// {{ $t.Name }}FieldID holds the string denoting the ID field of the {{ $t.Name }}.
|
||||
{{ $t.Name }}FieldID = "{{ $t.ID.StorageKey }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -5,7 +5,7 @@ in the LICENSE file in the root directory of this source tree.
|
||||
*/}}
|
||||
|
||||
{{ define "dialect/sql/txoptions" }}
|
||||
// BeginTx returns a transactional client with options.
|
||||
// BeginTx returns a transactional client with specified options.
|
||||
func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
|
||||
if _, ok := c.driver.(*txDriver); ok {
|
||||
return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
|
||||
|
||||
Reference in New Issue
Block a user