体验新版 GitCode,发现更多精彩内容 >>
package commands import ( "github.com/bmizerany/assert" "testing" ) func TestParsePullRequestId(t *testing.T) { url := "https://github.com/jingweno/gh/pull/73" assert.Equal(t, "73", parsePullRequestId(url)) url = "https://github.com/jingweno/gh/pull/" assert.Equal(t, "", parsePullRequestId(url)) }