Format all go files
This commit is contained in:
parent
2a0e84cdcb
commit
68b160997d
|
|
@ -1,18 +1,16 @@
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"math/rand"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
|
"net/http/httptest"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/mode"
|
"github.com/gotify/server/mode"
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,9 @@ package api
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
|
||||||
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/mode"
|
"github.com/gotify/server/mode"
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,10 @@ package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
"github.com/gotify/location"
|
"github.com/gotify/location"
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,18 @@ package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/gotify/server/auth"
|
||||||
"github.com/gotify/server/mode"
|
"github.com/gotify/server/mode"
|
||||||
"github.com/gotify/server/model"
|
"github.com/gotify/server/model"
|
||||||
"github.com/gotify/server/test"
|
"github.com/gotify/server/test"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"github.com/gotify/server/auth"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessageSuite(t *testing.T) {
|
func TestMessageSuite(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
package stream
|
package stream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync/atomic"
|
|
||||||
"sync"
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Modified version of sync.Once (https://github.com/golang/go/blob/master/src/sync/once.go)
|
// Modified version of sync.Once (https://github.com/golang/go/blob/master/src/sync/once.go)
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
package stream
|
package stream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/gotify/server/auth"
|
"github.com/gotify/server/auth"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package stream
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
|
@ -10,8 +11,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/fortytw2/leaktest"
|
"github.com/fortytw2/leaktest"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
|
|
||||||
6
app.go
6
app.go
|
|
@ -1,12 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gotify/server/config"
|
"github.com/gotify/server/config"
|
||||||
"github.com/gotify/server/database"
|
"github.com/gotify/server/database"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,8 @@ package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
|
||||||
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package docs
|
package docs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gobuffalo/packr"
|
"github.com/gobuffalo/packr"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Serve serves the documentation.
|
// Serve serves the documentation.
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,11 @@ package error
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/model"
|
"github.com/gotify/server/model"
|
||||||
"gopkg.in/go-playground/validator.v8"
|
"gopkg.in/go-playground/validator.v8"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,22 @@
|
||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/api"
|
|
||||||
"github.com/gotify/server/auth"
|
|
||||||
"github.com/gotify/server/database"
|
|
||||||
"github.com/gotify/server/error"
|
|
||||||
"github.com/gotify/server/ui"
|
|
||||||
"github.com/jmattheis/go-packr-swagger-ui"
|
|
||||||
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gotify/location"
|
"github.com/gotify/location"
|
||||||
|
"github.com/gotify/server/api"
|
||||||
"github.com/gotify/server/api/stream"
|
"github.com/gotify/server/api/stream"
|
||||||
|
"github.com/gotify/server/auth"
|
||||||
"github.com/gotify/server/config"
|
"github.com/gotify/server/config"
|
||||||
|
"github.com/gotify/server/database"
|
||||||
"github.com/gotify/server/docs"
|
"github.com/gotify/server/docs"
|
||||||
|
"github.com/gotify/server/error"
|
||||||
"github.com/gotify/server/mode"
|
"github.com/gotify/server/mode"
|
||||||
"github.com/gotify/server/model"
|
"github.com/gotify/server/model"
|
||||||
|
"github.com/gotify/server/ui"
|
||||||
|
"github.com/jmattheis/go-packr-swagger-ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create creates the gin engine with all routes.
|
// Create creates the gin engine with all routes.
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@ package runner
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/config"
|
"github.com/gotify/server/config"
|
||||||
"golang.org/x/crypto/acme/autocert"
|
"golang.org/x/crypto/acme/autocert"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue