Skip to content

danger/golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

273d1df · Nov 22, 2024

History

43 Commits
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Aug 23, 2023
Apr 8, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Jan 21, 2023
Nov 22, 2024
Nov 22, 2024
Mar 17, 2024
Jul 22, 2024
Jan 13, 2023

Repository files navigation

Danger in Go

This is a Go version of the popular Danger tool.

Installation of command line tool

go install github.com/danger/golang/cmd/danger-go@latest
yarn global add danger

Requires Danger JS to run properly.

Integrate into project

  1. Create a new directory to house the dangerfile.go file. This repo uses build/ci.
  2. Add a dangerfile.go to the directory with the following contents:
package main

import "github.com/danger/golang"

func Run(d *danger.T, pr danger.DSL) {
	d.Message("danger-go is running!", "", 0)
}
  1. Run the following in the directory:
go mod init dangerfile
go get github.com/danger/golang
go mod tidy

Running danger-go locally

The danger-go command line tool supports local, pr, and ci commands. danger-go wraps the corresponding danger (js) commands, so to get information about flags, run danger <command> --help.

CI integration

GitHub Actions

See .github/workflows/main.yml as a reference.

Authors

danger-go was developed by Luno.