Sha256: 2996b7218c87141d0ed9af0369554b71d229ffae013f9286e635b99228f0a50f

Contents?: true

Size: 370 Bytes

Versions: 14

Compression:

Stored size: 370 Bytes

Contents

<%-
import 'context'
import model.package
-%>

func (s *<%= type.name %>) ByID(ctx context.Context, iD int64) (*<%= model.qualified_name %>, error) {
	r := <%= model.qualified_name %>{ID: iD}
	err := s.Get(ctx, &r)
	if err != nil {
		return nil, err
	}

	if s.Hook != nil {
		if err := s.Hook.AfterGet(ctx, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
goon_model_gen-0.4.3 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.4.2 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.4.1 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.4.0 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.3.1 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.3.0 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.5 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.4 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.3 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.2 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.1 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.2.0 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.1.3 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb
goon_model_gen-0.1.2 lib/goon_model_gen/templates/store/goon/12_ByID.go.erb