MCPcopy
hub / github.com/syncthing/syncthing / updateDependencies

Function updateDependencies

build.go:840–858  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

838}
839
840func updateDependencies() {
841 // Figure out desired Go version
842 bs, err := os.ReadFile("go.mod")
843 if err != nil {
844 log.Fatal(err)
845 }
846 re := regexp.MustCompile(`(?m)^go\s+([0-9.]+)`)
847 matches := re.FindSubmatch(bs)
848 if len(matches) != 2 {
849 log.Fatal("failed to parse go.mod")
850 }
851 goVersion := string(matches[1])
852
853 runPrint(goCmd, "get", "-u", "./...")
854 runPrint(goCmd, "mod", "tidy", "-go="+goVersion, "-compat="+goVersion)
855
856 // We might have updated the protobuf package and should regenerate to match.
857 proto()
858}
859
860func proto() {
861 // buf needs to be installed

Callers 1

runCommandFunction · 0.85

Calls 3

runPrintFunction · 0.85
protoFunction · 0.85
FatalMethod · 0.80

Tested by

no test coverage detected