mattes / migrate

Database migrations. CLI and Golang library.
Other
2.29k stars 326 forks source link

Change GracefulStop into a RO channel #282

Open Freeaqingme opened 7 years ago

Freeaqingme commented 7 years ago

Migrate never writes to the GracefulStop channel, so why not guarantee that by turning the chan into a ReadOnly channel?

In my case I already had such a channel available which happened to be RO, so for me it wasn't just a nice to have, but sort of a necessity :)

I believe this change does not break BC.

Freeaqingme commented 7 years ago

Apparently the CLI tooling does write directly to the chan. Coming to think of it, other people may do that as well, since it's an exported property. It may be a nice change for the next major version then (given that I also fix the test)?