Пример #1
0
func main() {

	flag.Parse()

	data := flag.Arg(0)

	fmt.Println(len(data))
	fruits := []string{"Apple", "Banana", "Guava", "Mango", "Grapes", "Fig"}
	// fruits := data
	logging.LogData("Here is the Fruits Array Data", fruits)
	fmt.Println(fruits)

	comp := []string{"www.flipkart.com", "www.snapdeal.com", "www.ebay.com", "www.bestbuy.com"}
	logging.LogData("Here is the Ecommerece based Data", comp)
	fmt.Println(comp)

	fmt.Println(comp[:2])

}
Пример #2
0
func main() {

	logging.LogData("We are in the main func")

	data := make([]string, 5)

	/*data = append(data, "Mango")
	data = append(data, "Apple")
	data = append(data, "Grapes")
	data = append(data, "Orange")
	*/
	data[0] = "Mango"
	data[1] = "Apple"
	data[2] = "Grapes"
	data[3] = "Orange"
	data[4] = "Banana"

	logging.LogData("Here is the Data")
	Fruits(data)

	logging.LogData(data[0])
	logging.LogData("Data is with related to Fruits")
}
Пример #3
0
func Fruits(fruits []string) {

	logging.LogData("We are in the Arrays code for Fruits Function", fruits)
	fmt.Println(fruits)

}
Пример #4
0
func EcommerceComp(comp []string) {

	logging.LogData("Ecommerce related Array example", comp)
	fmt.Println(comp)

}