init
continuous-integration/drone/push Build is passing Details

master
icechen 2021-12-28 16:09:37 +08:00
parent fe739c3797
commit 257a78d24a
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package go_coverter
import ( import (
"context" "context"
"encoding/json"
"fmt" "fmt"
"github.com/drone/drone-go/drone" "github.com/drone/drone-go/drone"
@ -16,7 +17,12 @@ func New() converter.Plugin {
type plugin struct{} type plugin struct{}
func (p *plugin) Convert(ctx context.Context, req *converter.Request) (*drone.Config, error) { func (p *plugin) Convert(ctx context.Context, req *converter.Request) (*drone.Config, error) {
fmt.Printf("%+v", *req) resp, err := json.Marshal(req)
if err != nil {
fmt.Printf("%+v", err)
return nil, err
}
fmt.Printf("%s", string(resp))
return &drone.Config{ return &drone.Config{
Data: req.Config.Data, Data: req.Config.Data,
}, nil }, nil