File tree 10 files changed +54
-1
lines changed
10 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright 2021 Pants project contributors.
2
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
3
4
+ go_package ()
5
+
4
6
# This target allows us to use `./pants run` and `./pants package` on this `main` Go package.
5
7
#
6
8
# You can optionally set the field `output_path="greeter_en"`, for example, for the binary's name
Original file line number Diff line number Diff line change 1
1
# Copyright 2021 Pants project contributors.
2
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
3
4
+ go_package ()
5
+
4
6
# This target allows us to use `./pants run` and `./pants package` on this `main` Go package.
5
7
#
6
8
# You can optionally set the field `output_path="greeter_es"`, for example, for the binary's name
Original file line number Diff line number Diff line change 2
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
3
4
4
[GLOBAL ]
5
- pants_version = " 2.8.0 "
5
+ pants_version = " 2.9.0.dev3 "
6
6
backend_packages = [" pants.backend.experimental.go" ]
7
7
8
8
[anonymous-telemetry ]
Original file line number Diff line number Diff line change
1
+ # Copyright 2021 Pants project contributors.
2
+ # Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ go_package (dependencies = [":embeds" , ":testdata" ])
5
+
6
+ resources (name = "embeds" , sources = ["hello.txt" ])
7
+ files (name = "testdata" , sources = ["testdata/*" ])
Original file line number Diff line number Diff line change
1
+ I'm an embedded resource!
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 Pants project contributors.
2
+ // Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ package embed_example
5
+
6
+ // TODO: enable after fixing Pants when lib code has embeds but tests don't.
7
+ // import _ "embed"
8
+ // //go:embed hello.txt
9
+ // var embeddedHello string
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 Pants project contributors.
2
+ // Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ package embed_example
5
+
6
+ import (
7
+ "os"
8
+ "testing"
9
+ )
10
+
11
+ // TODO: enable after fixing Pants when lib code has embeds but tests don't.
12
+ // func TestResourceEmbedding(t *testing.T) {
13
+ // if embeddedHello != "I'm an embedded resource!" {
14
+ // t.Fatalf("message mismatch: want=%s; got=%s", "I'm an embedded resource!", embeddedHello)
15
+ // }
16
+ // }
17
+
18
+ func TestTestDataFolder (t * testing.T ) {
19
+ _ , err := os .Stat ("testdata/f.txt" )
20
+ if err != nil {
21
+ t .Fatalf ("Could not stat pkg/embed_example/testdata/f.txt: %v" , err )
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ Some test data!
Original file line number Diff line number Diff line change
1
+ # Copyright 2021 Pants project contributors.
2
+ # Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ go_package ()
Original file line number Diff line number Diff line change
1
+ # Copyright 2021 Pants project contributors.
2
+ # Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ go_package ()
You can’t perform that action at this time.
0 commit comments