mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 08:20:28 +00:00
Merge branch 'develop' into neilalexander/refactor
This commit is contained in:
commit
dd66e8a9c9
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
goversion: ["1.17", "1.18"]
|
goversion: ["1.17", "1.18", "1.19"]
|
||||||
|
|
||||||
name: Build & Test (Linux, Go ${{ matrix.goversion }})
|
name: Build & Test (Linux, Go ${{ matrix.goversion }})
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
@ -75,7 +75,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
goversion: ["1.17", "1.18"]
|
goversion: ["1.17", "1.18", "1.19"]
|
||||||
|
|
||||||
name: Build & Test (Windows, Go ${{ matrix.goversion }})
|
name: Build & Test (Windows, Go ${{ matrix.goversion }})
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
@ -99,7 +99,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
goversion: ["1.17", "1.18"]
|
goversion: ["1.17", "1.18", "1.19"]
|
||||||
|
|
||||||
name: Build & Test (macOS, Go ${{ matrix.goversion }})
|
name: Build & Test (macOS, Go ${{ matrix.goversion }})
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
@ -148,7 +148,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
env:
|
env:
|
||||||
@ -180,7 +180,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
env:
|
env:
|
||||||
@ -212,7 +212,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: sh contrib/msi/build-msi.sh ${{ matrix.pkgarch }}
|
run: sh contrib/msi/build-msi.sh ${{ matrix.pkgarch }}
|
||||||
@ -248,7 +248,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
env:
|
env:
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -51,10 +51,10 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf
|
|||||||
var err error
|
var err error
|
||||||
if useconffile != "" {
|
if useconffile != "" {
|
||||||
// Read the file from the filesystem
|
// Read the file from the filesystem
|
||||||
conf, err = ioutil.ReadFile(useconffile)
|
conf, err = os.ReadFile(useconffile)
|
||||||
} else {
|
} else {
|
||||||
// Read the file from stdin.
|
// Read the file from stdin.
|
||||||
conf, err = ioutil.ReadAll(os.Stdin)
|
conf, err = io.ReadAll(os.Stdin)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ func (cmdLineEnv *CmdLineEnv) parseFlagsAndArgs() {
|
|||||||
|
|
||||||
func (cmdLineEnv *CmdLineEnv) setEndpoint(logger *log.Logger) {
|
func (cmdLineEnv *CmdLineEnv) setEndpoint(logger *log.Logger) {
|
||||||
if cmdLineEnv.server == cmdLineEnv.endpoint {
|
if cmdLineEnv.server == cmdLineEnv.endpoint {
|
||||||
if config, err := ioutil.ReadFile(defaults.GetDefaults().DefaultConfigFile); err == nil {
|
if config, err := os.ReadFile(defaults.GetDefaults().DefaultConfigFile); err == nil {
|
||||||
if bytes.Equal(config[0:2], []byte{0xFF, 0xFE}) ||
|
if bytes.Equal(config[0:2], []byte{0xFF, 0xFE}) ||
|
||||||
bytes.Equal(config[0:2], []byte{0xFE, 0xFF}) {
|
bytes.Equal(config[0:2], []byte{0xFE, 0xFF}) {
|
||||||
utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM)
|
utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/ed25519"
|
"crypto/ed25519"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -67,7 +67,7 @@ func New(secret ed25519.PrivateKey, opts ...SetupOption) (*Core, error) {
|
|||||||
c._applyOption(opt)
|
c._applyOption(opt)
|
||||||
}
|
}
|
||||||
if c.log == nil {
|
if c.log == nil {
|
||||||
c.log = log.New(ioutil.Discard, "", 0)
|
c.log = log.New(io.Discard, "", 0)
|
||||||
}
|
}
|
||||||
c.proto.init(c)
|
c.proto.init(c)
|
||||||
if err := c.links.init(c); err != nil {
|
if err := c.links.init(c); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user