<commit_before>package goftp

import "testing"
import "os"

//import "strings"

//import "strings"

import "fmt"

var goodServer string
var uglyServer string
var badServer string

func init() {
	//ProFTPD 1.3.5 Server (Debian)
	goodServer = "bo.mirror.garr.it:21"

	//Symantec EMEA FTP Server
	badServer = "ftp.packardbell.com:21"

	//Unknown server
	uglyServer = "ftp.musicbrainz.org:21"
}

func active(host string) (msg string) {
	var err error
	var connection *FTP

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}
	code, response := connection.RawPassiveCmd("LIST .")
	if code < 0 || code > 299 {
		return fmt.Sprintf("Can't list -> %d", code)
	}
	fmt.Println(response)
	connection.Close()
	return ""

}

func standard(host string) (msg string) {
	var err error
	var connection *FTP

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}
	code, str := connection.RawCmd("FEAT")
	if code < 0 || code > 299 {
		return fmt.Sprintf("Can't FEAT -> %d", code)
	} else {
		fmt.Println(str)
	}

	connection.Close()
	return ""
}

func walk(host string) (msg string) {
	var err error
	var connection *FTP
	deep := 5

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}

	err = connection.Walk("/", func(path string, info os.FileMode, err error) error {
		fmt.Print("--->")
		fmt.Println(path)
		return nil

	}, deep)
	//if err != nil && !strings.HasPrefix(err.Error(), "550") {
	if err != nil {
		return "Can't walk ->" + err.Error()
	}
	connection.Close()
	return ""<commit_msg>decreased deep limit in test<commit_after>package goftp

import "testing"
import "os"

//import "strings"

//import "strings"

import "fmt"

var goodServer string
var uglyServer string
var badServer string

func init() {
	//ProFTPD 1.3.5 Server (Debian)
	//goodServer = "bo.mirror.garr.it:21"
	goodServer = "ftp.fu-berlin.de:21"

	//Symantec EMEA FTP Server
	badServer = "ftp.packardbell.com:21"

	//Unknown server
	uglyServer = "ftp.musicbrainz.org:21"
}

func active(host string) (msg string) {
	var err error
	var connection *FTP

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}
	code, response := connection.RawPassiveCmd("LIST .")
	if code < 0 || code > 299 {
		return fmt.Sprintf("Can't list -> %d", code)
	}
	fmt.Println(response)
	connection.Close()
	return ""

}

func standard(host string) (msg string) {
	var err error
	var connection *FTP

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}
	code, str := connection.RawCmd("FEAT")
	if code < 0 || code > 299 {
		return fmt.Sprintf("Can't FEAT -> %d", code)
	} else {
		fmt.Println(str)
	}

	connection.Close()
	return ""
}

func walk(host string) (msg string) {
	var err error
	var connection *FTP
	deep := 2
	filehit := 0

	if connection, err = Connect(host); err != nil {
		return "Can't connect ->" + err.Error()
	}
	if err = connection.Login("anonymous", "anonymous"); err != nil {
		return "Can't login ->" + err.Error()
	}

	err = connection.Walk("/", func(path string, info os.FileMode, err error) error {
		fmt.Print("--->")
		filehit = filehit + 1
		fmt.Println(path)
		return nil

	}, deep)
	//if err != nil && !strings.HasPrefix(err.Error(), "550") {
	if err != nil {
		return "Can't walk " + host + " ->" + err.Error()
	}
	if filehit < 1 {
		return "Can't walk " + host + " -> No file found"
	}

	connection.Close()
	return ""
{'fraction_non_alphanumeric': 0.16790306627101878, 'fraction_numerical': 0.01162215628090999, 'mean_word_length': 3.524608501118568, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4955298', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1439, 'n_words': 412}