mirror of
https://github.com/go-i2p/go-i2ptunnel-config.git
synced 2025-07-13 06:07:49 -04: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))
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ func (c *Converter) validate(config *TunnelConfig) error {
|
||||
// Converter handles configuration format conversions
|
||||
type Converter struct {
|
||||
strict bool
|
||||
//logger Logger
|
||||
// logger Logger
|
||||
}
|
||||
|
||||
// Convert transforms between configuration formats
|
||||
|
@ -23,8 +23,12 @@ func (c *Converter) parseINI(input []byte) (*TunnelConfig, error) {
|
||||
|
||||
parts := strings.SplitN(line, "=", 2)
|
||||
if len(parts) != 2 {
|
||||
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
|
||||
config.Name = strings.TrimSuffix(strings.TrimPrefix(line, "["), "]")
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
key := strings.TrimSpace(parts[0])
|
||||
value := strings.TrimSpace(parts[1])
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
"github.com/magiconair/properties"
|
||||
)
|
||||
|
||||
// Example Java properties parser
|
||||
func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
|
||||
p := properties.MustLoadString(string(input))
|
||||
|
||||
@ -27,7 +26,7 @@ func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
|
||||
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, "#") {
|
||||
return
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package i2pconv
|
||||
|
||||
import "gopkg.in/yaml.v2"
|
||||
|
||||
// Example YAML parser
|
||||
func (c *Converter) parseYAML(input []byte) (*TunnelConfig, error) {
|
||||
config := &TunnelConfig{}
|
||||
err := yaml.Unmarshal(input, config)
|
||||
|
Reference in New Issue
Block a user