Skip to content
Merged
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
135 changes: 69 additions & 66 deletions projects/golang.org/tools/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ companions:

build:
dependencies:
go.dev: ~1.25
go.dev: ~1.26.0
script:
- go mod download
- go build -v -trimpath -ldflags="$GO_LDFLAGS" -o {{prefix}}/bin/goimports ./cmd/goimports
Expand All @@ -37,77 +37,80 @@ build:
- -buildmode=pie

test:
# goimports
- run: goimports -d $FIXTURE | tee out
fixture:
extname: go
contents: |
package main
dependencies:
go.dev: ~1.26.0
script:
# goimports
- run: goimports -d $FIXTURE | tee out
fixture:
extname: go
contents: |
package main

func main() {
fmt.Println("hello")
}
- grep '+import "fmt"' out
# callgraph
- run: callgraph $FIXTURE | tee out
fixture:
extname: go
contents: |
package main
func main() {
fmt.Println("hello")
}
- grep '+import "fmt"' out
# callgraph
- run: callgraph $FIXTURE | tee out
fixture:
extname: go
contents: |
package main

import "fmt"
import "fmt"

func main() {
fmt.Println("hello")
}
- grep "fmt.Println" out
# digraph
- run: cp $FIXTURE clothes.txt
fixture: |
socks shoes
"boxer shorts" pants
pants belt shoes
shirt tie sweater
sweater jacket
hat
- cat clothes.txt | digraph reverse jacket | tee out
- run: test "$(cat out)" = "$(cat $FIXTURE)"
fixture: |
jacket
shirt
sweater
func main() {
fmt.Println("hello")
}
- grep "fmt.Println" out
# digraph
- run: cp $FIXTURE clothes.txt
fixture: |
socks shoes
"boxer shorts" pants
pants belt shoes
shirt tie sweater
sweater jacket
hat
- cat clothes.txt | digraph reverse jacket | tee out
- run: test "$(cat out)" = "$(cat $FIXTURE)"
fixture: |
jacket
shirt
sweater

# stringer
- run: cp $FIXTURE pill.go
fixture: |
package main
# stringer
- run: cp $FIXTURE pill.go
fixture: |
package main

//go:generate stringer -type=Pill
type Pill int
//go:generate stringer -type=Pill
type Pill int

const (
Placebo Pill = iota
Aspirin
Ibuprofen
Paracetamol
)
- go mod init pilltest
- stringer -type=Pill
- grep "func (. Pill) String() string" pill_string.go
const (
Placebo Pill = iota
Aspirin
Ibuprofen
Paracetamol
)
- go mod init pilltest
- stringer -type=Pill
- grep "func (. Pill) String() string" pill_string.go

# toolstash
# this is just a basic smoke test to ensure the binary runs
- toolstash save
- toolstash restore
- run: toolstash go run $FIXTURE | tee out
fixture:
extname: go
contents: |
package main
# toolstash
# this is just a basic smoke test to ensure the binary runs
- toolstash save
- toolstash restore
- run: toolstash go run $FIXTURE | tee out
fixture:
extname: go
contents: |
package main

import "fmt"
import "fmt"

func main() {
fmt.Println("toolstash test")
}
- test "$(cat out)" = "toolstash test"
func main() {
fmt.Println("toolstash test")
}
- test "$(cat out)" = "toolstash test"
Loading