Skip to content

Commit

Permalink
module files and CI bash scripts
Browse files Browse the repository at this point in the history
- deleted the handler_test for now
- missing modules
- CI bash scripts
  • Loading branch information
sadasant committed Mar 4, 2019
1 parent 4f97aad commit f6b0b34
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 21 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ jobs:
paths:
- "/go/pkg"
- run:
name: test
command: go test
name: tests
command: ./test.bash
- run:
name: fmt
command: ./fmt-check.bash
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ You can also use @[stefanmaric](https://github.com/stefanmaric)'s

Make an issue or a pull request! :) Remember to `fmt` your `.go`s 😆

There are also some useful commands at the root of this directory.
They're bash executables since that's how [Go's
source](https://github.com/golang/go/tree/master/src) handles similar
scripts. The list follows:

- `test.bash`: Runs `go test` in all the submodules of this repo.
- `fmt.bash`: Runs `go fmt` in all the submodules of this repo.
- `fmt-check.bash`: Runs `go fmt -l .` in all the submodules of this
repo. If it finds files that don't have the proper formatting, it
will exit with status code 1. We use this one for CI purposes

## How to deploy

### Creating a Telegram Bot
Expand Down
3 changes: 3 additions & 0 deletions fmt-check.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [[ $(cd gh && gofmt -l .) ]]; then exit 1; fi
if [[ $(cd handler && gofmt -l .) ]]; then exit 1; fi
if [[ $(cd tg && gofmt -l .) ]]; then exit 1; fi
3 changes: 3 additions & 0 deletions fmt.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(cd gh && go fmt $@)
(cd handler && go fmt $@)
(cd tg && go fmt $@)
8 changes: 8 additions & 0 deletions gh/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/berserktech/telebot/gh

go 1.12

require (
github.com/stretchr/testify v1.3.0
gopkg.in/go-playground/webhooks.v5 v5.6.0
)
9 changes: 9 additions & 0 deletions gh/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
gopkg.in/go-playground/webhooks.v5 v5.6.0 h1:z7O1sg1HiNQjoZKALAD6YMcZWgVCgYQmBjoVrbNv3+c=
gopkg.in/go-playground/webhooks.v5 v5.6.0/go.mod h1:LZbya/qLVdbqDR1aKrGuWV6qbia2zCYSR5dpom2SInQ=
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module github.com/berserktech/telebot
go 1.12

require (
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
github.com/stretchr/testify v1.3.0
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
gopkg.in/go-playground/webhooks.v5 v5.6.0
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b
github.com/berserktech/telebot/handler v0.0.0-20190304044943-f23b8172bf1b
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
github.com/berserktech/telebot/gh v0.0.0-20190304043952-352c432d8ea3 h1:SxKGhReIAy12PWQ0/8dXtLkOb5waWOY3cuMXSDM4jdk=
github.com/berserktech/telebot/gh v0.0.0-20190304043952-352c432d8ea3/go.mod h1:+JYyEG3Yiew/VkGIxDGMQslPsVdDixTNNUwVbXSg900=
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b h1:DOfFYj0Vhx2Cmu3rh/S7SIbr1cxhuGyFLvPgS+KnM0g=
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b/go.mod h1:+JYyEG3Yiew/VkGIxDGMQslPsVdDixTNNUwVbXSg900=
github.com/berserktech/telebot/handler v0.0.0-20190304044943-f23b8172bf1b h1:GoIBGK5HeG8qcyIHnIwgjKyUwR1e617fmwPevixYZLg=
github.com/berserktech/telebot/handler v0.0.0-20190304044943-f23b8172bf1b/go.mod h1:ayZ7mPlETwebs6UjLIETqbAhA3RgfsnjQuMeJmWTMgc=
github.com/berserktech/telebot/tg v0.0.0-20190304043952-352c432d8ea3 h1:fenIkzK1Te5elymv+/BSmLoAEyFCSc4qMkCUdUmKAsk=
github.com/berserktech/telebot/tg v0.0.0-20190304043952-352c432d8ea3/go.mod h1:UmjW19xAK+WFJnyvM+TFFZeueQaaFfVKoqDInnNpFvM=
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b h1:FOBJKVal+u6FkcPY1dYp6Y2KPAXUK6dTnSx5c2B6nTU=
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b/go.mod h1:UmjW19xAK+WFJnyvM+TFFZeueQaaFfVKoqDInnNpFvM=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
Expand Down
9 changes: 9 additions & 0 deletions handler/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/berserktech/telebot/handler

go 1.12

require (
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
)
18 changes: 18 additions & 0 deletions handler/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
github.com/berserktech/telebot/gh v0.0.0-20190304043952-352c432d8ea3 h1:SxKGhReIAy12PWQ0/8dXtLkOb5waWOY3cuMXSDM4jdk=
github.com/berserktech/telebot/gh v0.0.0-20190304043952-352c432d8ea3/go.mod h1:+JYyEG3Yiew/VkGIxDGMQslPsVdDixTNNUwVbXSg900=
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b h1:DOfFYj0Vhx2Cmu3rh/S7SIbr1cxhuGyFLvPgS+KnM0g=
github.com/berserktech/telebot/gh v0.0.0-20190304044943-f23b8172bf1b/go.mod h1:+JYyEG3Yiew/VkGIxDGMQslPsVdDixTNNUwVbXSg900=
github.com/berserktech/telebot/tg v0.0.0-20190304043952-352c432d8ea3 h1:fenIkzK1Te5elymv+/BSmLoAEyFCSc4qMkCUdUmKAsk=
github.com/berserktech/telebot/tg v0.0.0-20190304043952-352c432d8ea3/go.mod h1:UmjW19xAK+WFJnyvM+TFFZeueQaaFfVKoqDInnNpFvM=
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b h1:FOBJKVal+u6FkcPY1dYp6Y2KPAXUK6dTnSx5c2B6nTU=
github.com/berserktech/telebot/tg v0.0.0-20190304044943-f23b8172bf1b/go.mod h1:UmjW19xAK+WFJnyvM+TFFZeueQaaFfVKoqDInnNpFvM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=
gopkg.in/go-playground/webhooks.v5 v5.6.0 h1:z7O1sg1HiNQjoZKALAD6YMcZWgVCgYQmBjoVrbNv3+c=
gopkg.in/go-playground/webhooks.v5 v5.6.0/go.mod h1:LZbya/qLVdbqDR1aKrGuWV6qbia2zCYSR5dpom2SInQ=
15 changes: 0 additions & 15 deletions handler/handler_test.go

This file was deleted.

3 changes: 3 additions & 0 deletions test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go test ./gh
go test ./tg
go test ./handler
8 changes: 8 additions & 0 deletions tg/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/berserktech/telebot/tg

go 1.12

require (
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
)
4 changes: 4 additions & 0 deletions tg/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=

0 comments on commit f6b0b34

Please sign in to comment.