gofumpt adjustment

This commit is contained in:
Haris Khan
2024-10-31 10:53:22 -04:00
parent 487815f8f1
commit a17f0208dd
3 changed files with 9 additions and 5 deletions

View File

@ -1,11 +1,12 @@
package config
import (
"os"
"path/filepath"
"github.com/go-i2p/go-i2p/lib/util/logger"
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
"os"
"path/filepath"
)
var (
@ -24,7 +25,7 @@ func InitConfig() {
// Create default config if it doesn't exist
if _, err := os.Stat(defaultConfigFile); os.IsNotExist(err) {
// Ensure directory exists
if err := os.MkdirAll(defaultConfigDir, 0755); err != nil {
if err := os.MkdirAll(defaultConfigDir, 0o755); err != nil {
log.Fatalf("Could not create config directory: %s", err)
}
@ -47,7 +48,7 @@ func InitConfig() {
}
// Write default config file
if err := os.WriteFile(defaultConfigFile, yamlData, 0644); err != nil {
if err := os.WriteFile(defaultConfigFile, yamlData, 0o644); err != nil {
log.Fatalf("Could not write default config file: %s", err)
}

View File

@ -34,6 +34,7 @@ func (ns *NoiseSession) testEncryptPacket(plaintext []byte) (int, []byte, error)
return len(packet), packet, nil
}
func (ns *NoiseSession) testPacketDeux(packet []byte) (int, []byte, error) {
if ns.CipherState == nil {
return 0, nil, fmt.Errorf("CipherState is nil")
@ -60,6 +61,7 @@ func (ns *NoiseSession) testPacketDeux(packet []byte) (int, []byte, error) {
return len(plaintext), plaintext, nil
}
func TestEncryptDecryptPacketOffline(t *testing.T) {
// Generate static keypairs
initiatorStatic, err := noise.DH25519.GenerateKeypair(rand.Reader)

View File

@ -2,6 +2,8 @@ package main
import (
"fmt"
"os"
"github.com/go-i2p/go-i2p/lib/config"
"github.com/go-i2p/go-i2p/lib/router"
"github.com/go-i2p/go-i2p/lib/util/logger"
@ -9,7 +11,6 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
"os"
)
var (