1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

Reformat *.go with goimports command

This commit is contained in:
James Hillyerd
2014-05-19 19:40:33 -07:00
parent 63084c67b9
commit 88ae99abb0
20 changed files with 62 additions and 42 deletions

View File

@@ -3,10 +3,11 @@ package config
import (
"container/list"
"fmt"
"github.com/robfig/config"
"net"
"os"
"strings"
"github.com/robfig/config"
)
// SmtpConfig houses the SMTP server configuration - not using pointers

View File

@@ -7,16 +7,17 @@ import (
"expvar"
"flag"
"fmt"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/pop3d"
"github.com/jhillyerd/inbucket/smtpd"
"github.com/jhillyerd/inbucket/web"
golog "log"
"os"
"os/signal"
"syscall"
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/pop3d"
"github.com/jhillyerd/inbucket/smtpd"
"github.com/jhillyerd/inbucket/web"
)
var (

View File

@@ -4,14 +4,15 @@ import (
"bufio"
"bytes"
"fmt"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
"io"
"net"
"os"
"strconv"
"strings"
"time"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
)
type State int

View File

@@ -2,12 +2,13 @@ package pop3d
import (
"fmt"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
"net"
"sync"
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
)
// Real server code starts here

View File

@@ -2,10 +2,11 @@ package smtpd
import (
"errors"
"github.com/jhillyerd/go.enmime"
"io"
"net/mail"
"time"
"github.com/jhillyerd/go.enmime"
)
var ErrNotExist = errors.New("Message does not exist")

View File

@@ -5,9 +5,6 @@ import (
"encoding/gob"
"errors"
"fmt"
"github.com/jhillyerd/go.enmime"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"io"
"io/ioutil"
"net/mail"
@@ -15,6 +12,10 @@ import (
"path/filepath"
"sync"
"time"
"github.com/jhillyerd/go.enmime"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
)
// Name of index file in each mailbox

View File

@@ -3,8 +3,6 @@ package smtpd
import (
"bytes"
"fmt"
"github.com/jhillyerd/inbucket/config"
"github.com/stretchr/testify/assert"
"io"
"io/ioutil"
"log"
@@ -12,6 +10,9 @@ import (
"path/filepath"
"testing"
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/stretchr/testify/assert"
)
// Test directory structure created by filestore

View File

@@ -5,13 +5,14 @@ import (
"bytes"
"container/list"
"fmt"
"github.com/jhillyerd/inbucket/log"
"io"
"net"
"regexp"
"strconv"
"strings"
"time"
"github.com/jhillyerd/inbucket/log"
)
type State int

View File

@@ -3,8 +3,9 @@ package smtpd
import (
"bytes"
"fmt"
"github.com/jhillyerd/inbucket/config"
"io"
"github.com/jhillyerd/inbucket/config"
//"io/ioutil"
"log"
"net"

View File

@@ -4,12 +4,13 @@ import (
"container/list"
"expvar"
"fmt"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"net"
"strings"
"sync"
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
)
// Real server code starts here

View File

@@ -3,10 +3,11 @@ package smtpd
import (
"container/list"
"expvar"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"sync"
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
)
var retentionScanCompleted time.Time
@@ -30,8 +31,8 @@ func StartRetentionScanner(ds DataStore) {
if cfg.RetentionMinutes > 0 {
// Retention scanning enabled
log.LogInfo("Retention configured for %v minutes", cfg.RetentionMinutes)
go retentionScanner(ds, time.Duration(cfg.RetentionMinutes) * time.Minute,
time.Duration(cfg.RetentionSleep) * time.Millisecond)
go retentionScanner(ds, time.Duration(cfg.RetentionMinutes)*time.Minute,
time.Duration(cfg.RetentionSleep)*time.Millisecond)
} else {
log.LogInfo("Retention scanner disabled")
}

View File

@@ -2,12 +2,13 @@ package smtpd
import (
"fmt"
"github.com/jhillyerd/go.enmime"
"github.com/stretchr/testify/mock"
"io"
"net/mail"
"testing"
"time"
"github.com/jhillyerd/go.enmime"
"github.com/stretchr/testify/mock"
)
func TestDoRetentionScan(t *testing.T) {

View File

@@ -1,11 +1,12 @@
package web
import (
"net/http"
"strings"
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
"github.com/jhillyerd/inbucket/smtpd"
"net/http"
"strings"
)
type Context struct {

View File

@@ -2,12 +2,13 @@ package web
import (
"fmt"
"github.com/jhillyerd/inbucket/log"
"html"
"html/template"
"regexp"
"strings"
"time"
"github.com/jhillyerd/inbucket/log"
)
var TemplateFuncs = template.FuncMap{

View File

@@ -1,9 +1,10 @@
package web
import (
"github.com/stretchr/testify/assert"
"html/template"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTextToHtml(t *testing.T) {

View File

@@ -2,14 +2,15 @@ package web
import (
"fmt"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
"html/template"
"io"
"net/http"
"net/mail"
"strconv"
"time"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
)
type JsonMessageHeader struct {

View File

@@ -4,10 +4,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/jhillyerd/go.enmime"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/smtpd"
"github.com/stretchr/testify/mock"
"io"
"log"
"net/http"
@@ -16,6 +12,11 @@ import (
"os"
"testing"
"time"
"github.com/jhillyerd/go.enmime"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/smtpd"
"github.com/stretchr/testify/mock"
)
type OutputJsonHeader struct {

View File

@@ -2,10 +2,11 @@ package web
import (
"fmt"
"github.com/jhillyerd/inbucket/config"
"html/template"
"io/ioutil"
"net/http"
"github.com/jhillyerd/inbucket/config"
)
func RootIndex(w http.ResponseWriter, req *http.Request, ctx *Context) (err error) {

View File

@@ -5,15 +5,16 @@ package web
import (
"fmt"
"net"
"net/http"
"time"
"github.com/goods/httpbuf"
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/smtpd"
"net"
"net/http"
"time"
)
type handler func(http.ResponseWriter, *http.Request, *Context) error

View File

@@ -1,13 +1,14 @@
package web
import (
"github.com/jhillyerd/inbucket/log"
"html/template"
"net/http"
"path"
"path/filepath"
"strings"
"sync"
"github.com/jhillyerd/inbucket/log"
)
var cachedMutex sync.Mutex