bump requirements up to go 1.13

don't forget main.go
This commit is contained in:
Azareal 2020-02-23 19:27:35 +10:00
parent 459d745cb1
commit 0865dd4651
3 changed files with 23 additions and 11 deletions

View File

@ -3,7 +3,6 @@ env:
- CC_TEST_REPORTER_ID=38ad11f95f28b1d33c9c31467f9eb5eb4e336e4e0e36046c86a4f7ff6e4c3977
language: go
go:
- "1.12"
- "1.13"
- master
before_install:

View File

@ -37,7 +37,7 @@ Other modern features like alerts, likes, advanced dashboard with live stats (CP
# Requirements
Go 1.12 or newer - You will need to install this. Pick the .msi, if you want everything sorted out for you rather than having to go around updating the environment settings. https://golang.org/doc/install
Go 1.13 or newer - You will need to install this. Pick the .msi, if you want everything sorted out for you rather than having to go around updating the environment settings. https://golang.org/doc/install
For Ubuntu, you can consult: https://tecadmin.net/install-go-on-ubuntu/
You will also want to run `ln -s /usr/local/go/bin/go` (replace /usr/local with where ever you put Go), so that go becomes visible to other users.

31
main.go
View File

@ -25,13 +25,14 @@ import (
"time"
c "github.com/Azareal/Gosora/common"
_ "github.com/Azareal/Gosora/extend"
co "github.com/Azareal/Gosora/common/counters"
p "github.com/Azareal/Gosora/common/phrases"
meta "github.com/Azareal/Gosora/common/meta"
"github.com/Azareal/Gosora/query_gen"
p "github.com/Azareal/Gosora/common/phrases"
_ "github.com/Azareal/Gosora/extend"
qgen "github.com/Azareal/Gosora/query_gen"
"github.com/Azareal/Gosora/routes"
"github.com/fsnotify/fsnotify"
//"github.com/lucas-clemente/quic-go/http3"
"github.com/pkg/errors"
)
@ -56,13 +57,13 @@ func afterDBInit() (err error) {
log.Print("Exitted storeInit")
var uids []int
tcache := c.Topics.GetCache()
if tcache != nil {
tc := c.Topics.GetCache()
if tc != nil {
// Preload ten topics to get the wheels going
var count = 10
if tcache.GetCapacity() <= 10 {
if tc.GetCapacity() <= 10 {
count = 2
if tcache.GetCapacity() <= 2 {
if tc.GetCapacity() <= 2 {
count = 0
}
}
@ -103,8 +104,8 @@ func afterDBInit() (err error) {
}
}
ucache := c.Users.GetCache()
if ucache != nil {
uc := c.Users.GetCache()
if uc != nil {
// Preload associated users too...
for _, uid := range uids {
_, _ = c.Users.Get(uid)
@ -315,6 +316,10 @@ func storeInit() (err error) {
if err != nil {
return errors.WithStack(err)
}
co.PerfCounter, err = co.NewDefaultPerfCounter(acc)
if err != nil {
return errors.WithStack(err)
}
log.Print("Initialising the meta store")
c.Meta, err = meta.NewDefaultMetaStore(acc)
@ -623,6 +628,14 @@ func startServer() {
// TODO: Let users run *both* HTTP and HTTPS
log.Print("Initialising the HTTP server")
/*if c.Dev.QuicPort != 0 {
sQuicPort := strconv.Itoa(c.Dev.QuicPort)
log.Print("Listening on quic port " + sQuicPort)
go func() {
c.StoppedServer(http3.ListenAndServeQUIC(":"+sQuicPort, c.Config.SslFullchain, c.Config.SslPrivkey, router))
}()
}*/
if !c.Site.EnableSsl {
if c.Site.Port == "" {
c.Site.Port = "80"