mirror of
https://github.com/go-i2p/go-i2ptunnel-config.git
synced 2025-12-20 15:15:52 -05:00
Delete copypasta comments
This commit is contained in:
2
Makefile
Normal file
2
Makefile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fmt:
|
||||||
|
find . -name '*.go' -exec gofumpt -w -s -extra {} \;
|
||||||
@@ -39,7 +39,7 @@ func ConvertCommand(c *cli.Context) error {
|
|||||||
fmt.Println(string(outputData))
|
fmt.Println(string(outputData))
|
||||||
} else {
|
} else {
|
||||||
outputFile := c.Args().Get(1)
|
outputFile := c.Args().Get(1)
|
||||||
if err := os.WriteFile(outputFile, outputData, 0644); err != nil {
|
if err := os.WriteFile(outputFile, outputData, 0o644); err != nil {
|
||||||
return fmt.Errorf("failed to write output file: %w", err)
|
return fmt.Errorf("failed to write output file: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func (c *Converter) validate(config *TunnelConfig) error {
|
|||||||
// Converter handles configuration format conversions
|
// Converter handles configuration format conversions
|
||||||
type Converter struct {
|
type Converter struct {
|
||||||
strict bool
|
strict bool
|
||||||
//logger Logger
|
// logger Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert transforms between configuration formats
|
// Convert transforms between configuration formats
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ func (c *Converter) parseINI(input []byte) (*TunnelConfig, error) {
|
|||||||
|
|
||||||
parts := strings.SplitN(line, "=", 2)
|
parts := strings.SplitN(line, "=", 2)
|
||||||
if len(parts) != 2 {
|
if len(parts) != 2 {
|
||||||
continue
|
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
|
||||||
|
config.Name = strings.TrimSuffix(strings.TrimPrefix(line, "["), "]")
|
||||||
|
} else {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key := strings.TrimSpace(parts[0])
|
key := strings.TrimSpace(parts[0])
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/magiconair/properties"
|
"github.com/magiconair/properties"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Example Java properties parser
|
|
||||||
func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
|
func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
|
||||||
p := properties.MustLoadString(string(input))
|
p := properties.MustLoadString(string(input))
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
|
|||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Converter) parsePropertyKey(k string, s string, config *TunnelConfig) {
|
func (c *Converter) parsePropertyKey(k, s string, config *TunnelConfig) {
|
||||||
if strings.HasPrefix(k, "#") {
|
if strings.HasPrefix(k, "#") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package i2pconv
|
|||||||
|
|
||||||
import "gopkg.in/yaml.v2"
|
import "gopkg.in/yaml.v2"
|
||||||
|
|
||||||
// Example YAML parser
|
|
||||||
func (c *Converter) parseYAML(input []byte) (*TunnelConfig, error) {
|
func (c *Converter) parseYAML(input []byte) (*TunnelConfig, error) {
|
||||||
config := &TunnelConfig{}
|
config := &TunnelConfig{}
|
||||||
err := yaml.Unmarshal(input, config)
|
err := yaml.Unmarshal(input, config)
|
||||||
|
|||||||
Reference in New Issue
Block a user