Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for ReadBuildInfo (0.18 sec)

  1. src/cmd/go/testdata/script/mod_modinfo.txt

    // functions have run.
    package lib
    
    import "runtime/debug"
    
    func init() {
    	m, ok := debug.ReadBuildInfo()
    	if !ok {
    		panic("failed debug.ReadBuildInfo")
    	}
    	println("mod", m.Main.Path, m.Main.Version)
    	for _, d := range m.Deps {
    		println("dep", d.Path, d.Version, d.Sum)
    		if r := d.Replace; r != nil {
    			println("=>", r.Path, r.Version, r.Sum)
    		}
    	}
    }
    
    -- x/main.go --
    package main
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 19:12:23 UTC 2020
    - 1.8K bytes
    - Viewed (0)
  2. platforms/documentation/docs/src/snippets/multiproject/dependencies-outgoingArtifact/groovy/consumer/src/main/java/Application.java

    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    
    public class Application {
        public Properties readBuildInfo() throws IOException {
            Properties prop = new Properties();
            InputStream inputStream = null;
    
            try {
                inputStream = Application.class.getClassLoader().getResourceAsStream("build-info.properties");
                prop.load(inputStream);
            } finally {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 680 bytes
    - Viewed (0)
  3. platforms/documentation/docs/src/snippets/multiproject/dependencies-outgoingArtifact/groovy/consumer/src/test/java/ApplicationTest.java

    public class ApplicationTest {
        private final Application application = new Application();
    
        @Test
        public void testReadBuildInfo() throws IOException {
            Properties properties = application.readBuildInfo();
            assertEquals(properties.getProperty("version").toString(), "1.0");
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 434 bytes
    - Viewed (0)
  4. platforms/documentation/docs/src/snippets/multiproject/dependencies-outgoingArtifact/kotlin/consumer/src/main/java/Application.java

    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    
    public class Application {
        public Properties readBuildInfo() throws IOException {
            Properties prop = new Properties();
            InputStream inputStream = null;
    
            try {
                inputStream = Application.class.getClassLoader().getResourceAsStream("build-info.properties");
                prop.load(inputStream);
            } finally {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 680 bytes
    - Viewed (0)
  5. platforms/documentation/docs/src/snippets/multiproject/dependencies-outgoingArtifact/kotlin/consumer/src/test/java/ApplicationTest.java

    public class ApplicationTest {
        private final Application application = new Application();
    
        @Test
        public void testReadBuildInfo() throws IOException {
            Properties properties = application.readBuildInfo();
            assertEquals(properties.getProperty("version").toString(), "1.0");
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 434 bytes
    - Viewed (0)
  6. src/cmd/go/testdata/script/test_buildvcs.txt

    go 1.18
    -- example.go --
    package main
    -- example_test.go --
    package main
    
    import (
    	"runtime/debug"
    	"strings"
    	"testing"
    )
    
    func TestDetail(t *testing.T) {
    	bi, ok := debug.ReadBuildInfo()
    	if !ok {
    		t.Fatal("BuildInfo not present")
    	}
    	for _, s := range bi.Settings {
    		if strings.HasPrefix(s.Key, "vcs.") {
    			t.Fatalf("unexpected VCS setting: %s=%s", s.Key, s.Value)
    		}
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 21:18:32 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  7. src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt

    There is no go.mod file for this version of the module.
    -- printversion.go --
    package main
    
    import (
    	"fmt"
    	"os"
    	"runtime/debug"
    
    	_ "example.com/version"
    )
    
    func main() {
    	info, _ := debug.ReadBuildInfo()
    	fmt.Fprintf(os.Stdout, "path is %s\n", info.Path)
    	fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version)
    	if r := info.Main.Replace; r != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 25 15:43:19 UTC 2020
    - 781 bytes
    - Viewed (0)
  8. src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt

    exclude example.com/version v1.0.1
    -- printversion.go --
    package main
    
    import (
    	"fmt"
    	"os"
    	"runtime/debug"
    
    	_ "example.com/version"
    )
    
    func main() {
    	info, _ := debug.ReadBuildInfo()
    	fmt.Fprintf(os.Stdout, "path is %s\n", info.Path)
    	fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version)
    	if r := info.Main.Replace; r != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 25 15:43:19 UTC 2020
    - 1001 bytes
    - Viewed (0)
  9. src/runtime/debug/mod.go

    package debug
    
    import (
    	"fmt"
    	"runtime"
    	"strconv"
    	"strings"
    )
    
    // exported from runtime.
    func modinfo() string
    
    // ReadBuildInfo returns the build information embedded
    // in the running binary. The information is available only
    // in binaries built with module support.
    func ReadBuildInfo() (info *BuildInfo, ok bool) {
    	data := modinfo()
    	if len(data) < 32 {
    		return nil, false
    	}
    	data = data[16 : len(data)-16]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 25 15:06:51 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/telemetry/counter/counter.go

    // CountCommandLineFlags is called after flags are parsed,
    // the "compile/flag:S" counter will be incremented.
    func CountCommandLineFlags() {
    	prefix := "flag:"
    	if buildInfo, ok := debug.ReadBuildInfo(); ok && buildInfo.Path != "" {
    		prefix = path.Base(buildInfo.Path) + "/" + prefix
    	}
    	CountFlags(prefix, *flag.CommandLine)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 15 18:02:34 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top