chore: use gofumpt for code formatting
This commit is contained in:
@@ -10,13 +10,12 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrVPNTypeNotSupported = errors.New("VPN type not supported for custom provider")
|
||||
)
|
||||
var ErrVPNTypeNotSupported = errors.New("VPN type not supported for custom provider")
|
||||
|
||||
// GetConnection gets the connection from the OpenVPN configuration file.
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection, _ bool) (
|
||||
connection models.Connection, err error) {
|
||||
connection models.Connection, err error,
|
||||
) {
|
||||
switch selection.VPN {
|
||||
case vpn.OpenVPN:
|
||||
return getOpenVPNConnection(p.extractor, selection)
|
||||
@@ -29,7 +28,8 @@ func (p *Provider) GetConnection(selection settings.ServerSelection, _ bool) (
|
||||
|
||||
func getOpenVPNConnection(extractor Extractor,
|
||||
selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
connection models.Connection, err error,
|
||||
) {
|
||||
_, connection, err = extractor.Data(*selection.OpenVPN.ConfFile)
|
||||
if err != nil {
|
||||
return connection, fmt.Errorf("extracting connection: %w", err)
|
||||
@@ -52,7 +52,8 @@ func getOpenVPNConnection(extractor Extractor,
|
||||
}
|
||||
|
||||
func getWireguardConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection) {
|
||||
connection models.Connection,
|
||||
) {
|
||||
connection = models.Connection{
|
||||
Type: vpn.Wireguard,
|
||||
IP: selection.Wireguard.EndpointIP,
|
||||
|
||||
@@ -15,7 +15,8 @@ import (
|
||||
var ErrExtractData = errors.New("failed extracting information from custom configuration file")
|
||||
|
||||
func (p *Provider) OpenVPNConfig(connection models.Connection,
|
||||
settings settings.OpenVPN, ipv6Supported bool) (lines []string) {
|
||||
settings settings.OpenVPN, ipv6Supported bool,
|
||||
) (lines []string) {
|
||||
lines, _, err := p.extractor.Data(*settings.ConfFile)
|
||||
if err != nil {
|
||||
// Configuration file is already validated in settings validation in
|
||||
@@ -30,7 +31,8 @@ func (p *Provider) OpenVPNConfig(connection models.Connection,
|
||||
}
|
||||
|
||||
func modifyConfig(lines []string, connection models.Connection,
|
||||
settings settings.OpenVPN, ipv6Supported bool) (modified []string) {
|
||||
settings settings.OpenVPN, ipv6Supported bool,
|
||||
) (modified []string) {
|
||||
// Remove some lines
|
||||
for _, line := range lines {
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user