Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnik committed Jun 24, 2024
1 parent a0c79be commit 71a5ef2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ jobs:
run: |
mkdir -p ./secrets
echo "${{ secrets.TEST_FIREBASE_SERVICE_ACCOUNT_KEY_BASE64 }}" | base64 -d > ./secrets/firebase_service_account_key.json
ls -la ./secrets
- name: Run tests
run: |
ls -la ./secrets
TEST_FIREBASE_API_KEY=${{ secrets.TEST_FIREBASE_API_KEY }} make test
ci:
Expand Down
3 changes: 2 additions & 1 deletion services/server/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

var (
firebaseCredentialsFilename = "./secrets/firebase_service_account_key.json"
logFilename = "logfile.log"
)

func main() {
Expand All @@ -36,7 +37,7 @@ func main() {
googleGeocodeRepo := googlegeocode.NewGoogleGeocodeRepo(googleGeocodeApiKey)

// logger configuration
logFile, err := os.Create("logfile.log")
logFile, err := os.Create(logFilename)
exitOnError(err)
defer logFile.Close()

Expand Down
1 change: 0 additions & 1 deletion services/server/pkg/controllers/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"spaces-p/pkg/errors"
"spaces-p/pkg/models"
"spaces-p/pkg/services"

"spaces-p/pkg/utils"

"github.com/gin-gonic/gin"
Expand Down
4 changes: 2 additions & 2 deletions services/server/pkg/repositories/redis_repo/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func NewRedisRepository(redisClient *redis.Client) *RedisRepository {

func (repo *RedisRepository) DeleteAllKeys() error {
const op errors.Op = "redis_repo.RedisRepository.DeleteAllKeys"
isDevelopmentTestEnv := os.Getenv("ENVIRONMENT") == "development" || os.Getenv("ENVIRONMENT") == "test"
isDevOrTestEnv := os.Getenv("ENVIRONMENT") == "development" || os.Getenv("ENVIRONMENT") == "test"

if !isDevelopmentTestEnv {
if !isDevOrTestEnv {
return errors.E(op, common.ErrOnlyAllowedInDevEnv)
}

Expand Down
14 changes: 0 additions & 14 deletions services/server/pkg/utils/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,3 @@ func SliceContains[T string | int | bool](s []T, item T) bool {

return false
}

type Predicate[T any] func(T) bool

func FilterSlice[T any](s []T, predicate Predicate[T]) []T {
var filtered []T

for _, item := range s {
if predicate(item) {
filtered = append(filtered, item)
}
}

return filtered
}

0 comments on commit 71a5ef2

Please sign in to comment.