36 lines
915 B
Go
36 lines
915 B
Go
// Copyright © 2018 Inanc Gumus
|
|
// Learn Go Programming Course
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
//
|
|
// For more tutorials : https://learngoprogramming.com
|
|
// In-person training : https://www.linkedin.com/in/inancgumus/
|
|
// Follow me on twitter: https://twitter.com/inancgumus
|
|
|
|
package main
|
|
|
|
// ---------------------------------------------------------
|
|
// EXERCISE: Append #3 — Fix the problems
|
|
//
|
|
// Fix the problems in the code below.
|
|
//
|
|
// BONUS
|
|
//
|
|
// Simplify the code.
|
|
//
|
|
// EXPECTED OUTPUT
|
|
//
|
|
// toppings: [black olives green peppers onions extra cheese]
|
|
//
|
|
// ---------------------------------------------------------
|
|
|
|
func main() {
|
|
// toppings := []int{"black olives", "green peppers"}
|
|
|
|
// var pizza [3]string
|
|
// append(pizza, ...toppings)
|
|
// pizza = append(toppings, "onions")
|
|
// toppings = append(pizza, extra cheese)
|
|
|
|
// fmt.Printf("pizza : %s\n", pizza)
|
|
}
|