Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix go vet #240

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func insertActionList(ctx context.Context, db *sql.DB, yamlData string, id uuid.
if err != nil {
return errors.Wrap(err, "Invalid Template")
}
var actionList []pb.WorkflowAction
var actionList []*pb.WorkflowAction
var uniqueWorkerID uuid.UUID
for _, task := range wfymldata.Tasks {
taskEnvs := map[string]string{}
Expand Down Expand Up @@ -203,7 +203,7 @@ func insertActionList(ctx context.Context, db *sql.DB, yamlData string, id uuid.
Environment: envs,
Volumes: ac.Volumes,
}
actionList = append(actionList, action)
actionList = append(actionList, &action)
}
}
totalActions := int64(len(actionList))
Expand Down Expand Up @@ -637,7 +637,7 @@ func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *pb.W
}

// ShowWorkflowEvents returns all workflows
func ShowWorkflowEvents(db *sql.DB, wfID string, fn func(wfs pb.WorkflowActionStatus) error) error {
func ShowWorkflowEvents(db *sql.DB, wfID string, fn func(wfs *pb.WorkflowActionStatus) error) error {
rows, err := db.Query(`
SELECT worker_id, task_name, action_name, execution_time, message, status, created_at
FROM workflow_event
Expand Down Expand Up @@ -667,7 +667,7 @@ func ShowWorkflowEvents(db *sql.DB, wfID string, fn func(wfs pb.WorkflowActionSt
return err
}
createdAt, _ := ptypes.TimestampProto(evTime)
wfs := pb.WorkflowActionStatus{
wfs := &pb.WorkflowActionStatus{
WorkerId: id,
TaskName: tName,
ActionName: aName,
Expand Down
2 changes: 1 addition & 1 deletion grpc-server/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (s *server) ShowWorkflowEvents(req *workflow.GetRequest, stream workflow.Wo

timer := prometheus.NewTimer(metrics.CacheDuration.With(labels))
defer timer.ObserveDuration()
err := db.ShowWorkflowEvents(s.db, req.Id, func(w workflowpb.WorkflowActionStatus) error {
err := db.ShowWorkflowEvents(s.db, req.Id, func(w *workflowpb.WorkflowActionStatus) error {
wfs := &workflow.WorkflowActionStatus{
WorkerId: w.WorkerId,
TaskName: w.TaskName,
Expand Down