Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noamt/shinable
An example Go module for my talk at the Go Israel meetup
https://github.com/noamt/shinable
Last synced: 16 days ago
JSON representation
An example Go module for my talk at the Go Israel meetup
- Host: GitHub
- URL: https://github.com/noamt/shinable
- Owner: noamt
- Created: 2018-09-04T11:28:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T05:47:14.000Z (about 6 years ago)
- Last Synced: 2023-03-11T16:26:38.186Z (almost 2 years ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.asciidoc
Awesome Lists containing this project
README
= Shinable
A Go 1.11 demo repository.
== One
Simple module initialized with[source,bash]
----
export GO111MODULE=on
go mod init
----
This creates a `go.mod` file.After pushing the repository to github we can create a consumer module.
.consumer.go
[source,go]
----
package mainimport "github.com/youruser/shinable"
func main() {
println("Is it shiny?", shinable.Shinable("Shiny"))
}
----
Initialize the above module as well with```
go mod init consumer
```Then build and pull dependencies with `go build`.
Notice that within the `go.mod` file `shinable` is annotated with an "anonymous" version.
== Two
Update `shinable` with new code and push it.
The consumer won't get the new version until you run `go get -u`.At this point we can also push tag `v1.0.0` to `shinable`. *Notice the importance of `v` prefix*.
Still the consumer will only be updated with the latest version of `shinable` when we run `go get -u`.== Three
In this stage the API has been broken and has been pushed as tag `v2.0.0`.
Updating the consumer won't break it, but can be updated with
[source,go]
----
import "github.com/youruser/shinable/v2"
----