Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring #38

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/dependabot.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@

go fmt ./...
golint .
go test ./... -tags=unit -failfast
# shellcheck disable=SC2181
if [ $? != 0 ]
then
echo "Committed code break unit tests"
exit 1
fi

go test ./... -tags=stripe -failfast -config=ABS_PATH/config.json
go test ./... -failfast
# shellcheck disable=SC2181
if [ $? != 0 ]
then
echo "Committed code break Stripe tests"
echo "Committed code break tests"
exit 1
fi
50 changes: 0 additions & 50 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

21 changes: 8 additions & 13 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.14
uses: actions/[email protected]
with:
go-version: 1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
id: go

- name: Swagger - Installation
run: go get -u github.com/swaggo/swag/cmd/swag
run: go install github.com/swaggo/swag/cmd/swag@latest

- name: Swagger - Init
run: ~/go/bin/swag init
Expand All @@ -35,11 +33,8 @@ jobs:
cp config.json.dist config.json
sed -i 's/pk_xxx/${{ secrets.STRIPE_PK }}/g; s/sk_xxx/${{ secrets.STRIPE_SK }}/g' config.json

- name: Tests - Unit
run: go test ./... -failfast -tags=unit

- name: Tests - Stripe
run: go test ./... -failfast -tags=stripe -config=/home/runner/work/upaygo/upaygo/config.json
- name: Run Tests
run: go test ./... -failfast

- name: Build
run: go build -v .
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/.idea
/vendor
/docs
.idea
vendor
.vscode

/upaygo.iml
/config.json
upaygo.iml
config.json
2 changes: 2 additions & 0 deletions .idx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

gc/
37 changes: 37 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ pkgs, ... }: {

# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"

# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.go
pkgs.docker
];

# Sets environment variables in the workspace
env = { };

# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
idx.extensions = [
"open-vsx.go"
];

idx.workspace.onCreate = {
go-tidy = "go mod tidy";
go-vendor = "go mod vendor";
};

idx.workspace.onStart = {
go-tidy = "go mod tidy";
go-vendor = "go mod vendor";
};

services.docker.enable = true;

# Enable previews and customize configuration
idx.previews = {
enable = false;
previews = [ ];
};
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019 Daniele Rostellato
Copyright (c) 2024 Daniele Rostellato

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ go run main.go -config=config.json
## Tests

```bash
go test ./... -failfast -tags=unit
go test ./... -failfast -tags=stripe -config=ABS_PATH/config.json
go test ./... -failfast
```

### APIs
Expand Down
34 changes: 0 additions & 34 deletions amount/amount_test.go

This file was deleted.

135 changes: 0 additions & 135 deletions config/config_test.go

This file was deleted.

Loading