Commit c314bf18 authored by Vladimir Barsukov's avatar Vladimir Barsukov
Browse files

fix

parent 156d4a2a
package zcache package zcache
import ( import (
"github.com/patrickmn/go-cache"
"time" "time"
"github.com/patrickmn/go-cache"
) )
func New(defaultExpiration, cleanupInterval time.Duration) *cache.Cache { func New(defaultExpiration, cleanupInterval time.Duration) *cache.Cache {
......
package zcron package zcron
import ( import (
"github.com/go-co-op/gocron"
"time" "time"
"github.com/go-co-op/gocron"
) )
func New(loc *time.Location) *gocron.Scheduler { func New(loc *time.Location) *gocron.Scheduler {
...@@ -11,7 +12,6 @@ func New(loc *time.Location) *gocron.Scheduler { ...@@ -11,7 +12,6 @@ func New(loc *time.Location) *gocron.Scheduler {
func Default() *gocron.Scheduler { func Default() *gocron.Scheduler {
s := gocron.NewScheduler(time.UTC) s := gocron.NewScheduler(time.UTC)
s.SingletonModeAll()
return s return s
} }
...@@ -2,10 +2,11 @@ package zdb ...@@ -2,10 +2,11 @@ package zdb
import ( import (
"fmt" "fmt"
"reflect"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype" "github.com/jackc/pgx/v5/pgtype"
"reflect"
) )
func (d *Pool) WAny(dst any, sql string, args ...any) error { func (d *Pool) WAny(dst any, sql string, args ...any) error {
......
...@@ -2,6 +2,7 @@ package zdb ...@@ -2,6 +2,7 @@ package zdb
import ( import (
"fmt" "fmt"
"github.com/jackc/pgx/v5/pgxpool" "github.com/jackc/pgx/v5/pgxpool"
) )
......
...@@ -2,8 +2,9 @@ package zdb ...@@ -2,8 +2,9 @@ package zdb
import ( import (
"errors" "errors"
"github.com/jackc/pgx/v5"
"strings" "strings"
"github.com/jackc/pgx/v5"
) )
var ErrNoRows = pgx.ErrNoRows var ErrNoRows = pgx.ErrNoRows
......
...@@ -3,13 +3,14 @@ package zdb ...@@ -3,13 +3,14 @@ package zdb
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/jackc/pgx/v5/pgxpool"
"reflect" "reflect"
"runtime" "runtime"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/jackc/pgx/v5/pgxpool"
) )
type Pool struct { type Pool struct {
......
...@@ -2,11 +2,12 @@ package zdebug ...@@ -2,11 +2,12 @@ package zdebug
import ( import (
"fmt" "fmt"
"git.barsukov.pro/barsukov/zgo/zutils"
"log" "log"
"runtime" "runtime"
"strings" "strings"
"time" "time"
"git.barsukov.pro/barsukov/zgo/zutils"
) )
func NewMonitor(secs int) { func NewMonitor(secs int) {
......
...@@ -3,6 +3,7 @@ package zguid ...@@ -3,6 +3,7 @@ package zguid
import ( import (
"crypto/md5" "crypto/md5"
"fmt" "fmt"
"github.com/google/uuid" "github.com/google/uuid"
) )
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
package zjson package zjson
import ( import (
"github.com/goccy/go-json"
"unsafe" "unsafe"
"github.com/goccy/go-json"
) )
func ToBytes(obj any) ([]byte, error) { func ToBytes(obj any) ([]byte, error) {
......
...@@ -4,6 +4,7 @@ package zmigrations ...@@ -4,6 +4,7 @@ package zmigrations
import ( import (
"fmt" "fmt"
"git.barsukov.pro/barsukov/zgo/zdb" "git.barsukov.pro/barsukov/zgo/zdb"
) )
......
...@@ -3,9 +3,10 @@ package zmigrations ...@@ -3,9 +3,10 @@ package zmigrations
import ( import (
"embed" "embed"
"fmt" "fmt"
"git.barsukov.pro/barsukov/zgo/zdb"
"io/fs" "io/fs"
"log" "log"
"git.barsukov.pro/barsukov/zgo/zdb"
) )
func Migrations(db *zdb.Pool, files embed.FS, loc string, reCreateSchema ...string) error { func Migrations(db *zdb.Pool, files embed.FS, loc string, reCreateSchema ...string) error {
......
...@@ -2,9 +2,10 @@ package zq ...@@ -2,9 +2,10 @@ package zq
import ( import (
"fmt" "fmt"
"runtime"
"git.barsukov.pro/barsukov/zgo/zatomic" "git.barsukov.pro/barsukov/zgo/zatomic"
"git.barsukov.pro/barsukov/zgo/zquit" "git.barsukov.pro/barsukov/zgo/zquit"
"runtime"
) )
type ZQ struct { type ZQ struct {
......
...@@ -2,14 +2,15 @@ package zquit ...@@ -2,14 +2,15 @@ package zquit
import ( import (
"fmt" "fmt"
"git.barsukov.pro/barsukov/zgo/zwg"
"github.com/gin-gonic/gin"
"log" "log"
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
"time" "time"
"git.barsukov.pro/barsukov/zgo/zwg"
"github.com/gin-gonic/gin"
) )
type ZQuit struct { type ZQuit struct {
......
...@@ -3,11 +3,12 @@ package zs3 ...@@ -3,11 +3,12 @@ package zs3
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"io"
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3"
"io"
) )
type ZS3 struct { type ZS3 struct {
......
...@@ -2,8 +2,9 @@ package zsem ...@@ -2,8 +2,9 @@ package zsem
import ( import (
"context" "context"
"golang.org/x/sync/semaphore"
"runtime" "runtime"
"golang.org/x/sync/semaphore"
) )
type ZSem struct { type ZSem struct {
......
package zutils package zutils
import ( import (
"golang.org/x/exp/constraints"
"reflect" "reflect"
"sort" "sort"
"golang.org/x/exp/constraints"
) )
func ArrayUnique[T comparable](s []T) []T { func ArrayUnique[T comparable](s []T) []T {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment