d2plugin: Minor simplification
This commit is contained in:
parent
d87d897fdb
commit
9d3eb02406
1 changed files with 1 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ import (
|
||||||
// See implementation of d2plugin-dagre in the ./cmd directory.
|
// See implementation of d2plugin-dagre in the ./cmd directory.
|
||||||
//
|
//
|
||||||
// Also see execPlugin in exec.go for the d2 binary plugin protocol.
|
// Also see execPlugin in exec.go for the d2 binary plugin protocol.
|
||||||
func Serve(p Plugin) func(context.Context, *xmain.State) error {
|
func Serve(p Plugin) xmain.RunFunc {
|
||||||
return func(ctx context.Context, ms *xmain.State) (err error) {
|
return func(ctx context.Context, ms *xmain.State) (err error) {
|
||||||
if len(ms.Opts.Flags.Args()) < 1 {
|
if len(ms.Opts.Flags.Args()) < 1 {
|
||||||
return errors.New("expected first argument to plugin binary to be function name")
|
return errors.New("expected first argument to plugin binary to be function name")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue