diff --git a/hello/hello b/hello/hello new file mode 100755 index 0000000..026d3db Binary files /dev/null and b/hello/hello differ diff --git a/hello/hello.go b/hello/hello.go new file mode 100644 index 0000000..914fb3f --- /dev/null +++ b/hello/hello.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("Bonjour tout le Monde") +} + diff --git a/packages/file1.go b/packages/file1.go new file mode 100644 index 0000000..037c162 --- /dev/null +++ b/packages/file1.go @@ -0,0 +1,3 @@ +package main + +var data1 string = "Salut" diff --git a/packages/file2.go b/packages/file2.go new file mode 100644 index 0000000..34c9e0d --- /dev/null +++ b/packages/file2.go @@ -0,0 +1,3 @@ +package main + +var data2 = "tout le monde" diff --git a/packages/main.go b/packages/main.go new file mode 100644 index 0000000..135556c --- /dev/null +++ b/packages/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println(data1, data2) +} diff --git a/testexport/affiche/affiche.go b/testexport/affiche/affiche.go new file mode 100644 index 0000000..05ad75f --- /dev/null +++ b/testexport/affiche/affiche.go @@ -0,0 +1,9 @@ +package affiche + +var data = "E2L !" +var Number = 99 + +type Message struct { + Greeting string + voice string +} diff --git a/testexport/go.mod b/testexport/go.mod new file mode 100644 index 0000000..f6f83f6 --- /dev/null +++ b/testexport/go.mod @@ -0,0 +1,3 @@ +module githell.e2li.org/Patrick/LeGoEn10Etapes/testexport + +go 1.19 diff --git a/testexport/main.go b/testexport/main.go new file mode 100644 index 0000000..7fc1f2d --- /dev/null +++ b/testexport/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "githell.e2li.org/Patrick/LeGoEn10Etapes/testexport/affiche" +) + +func main() { + m := print.Message{ + Greeting: "Salut", + } + fmt.Println(print.Number) + fmt.Println(m.voice) + // fmt.Println(print.data) +} + +func Export() int { + return 42 +} + diff --git a/testimport/go.mod b/testimport/go.mod new file mode 100644 index 0000000..0f82789 --- /dev/null +++ b/testimport/go.mod @@ -0,0 +1,10 @@ +module testimport + +go 1.19 + +require ( + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/rs/zerolog v1.28.0 // indirect + golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect +) diff --git a/testimport/go.sum b/testimport/go.sum new file mode 100644 index 0000000..a5b0c11 --- /dev/null +++ b/testimport/go.sum @@ -0,0 +1,13 @@ +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= +github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/testimport/main.go b/testimport/main.go new file mode 100644 index 0000000..53a2d90 --- /dev/null +++ b/testimport/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" + // reference au compte github d'Olivier Poitrey !! + "github.com/rs/zerolog/log" +) + +func main() { + fmt.Println("Salut tout le Monde") + log.Print("Salut tout le Monde") +}