Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Creating a Structure | Intro to Structs & Maps
Introduction to GoLang
course content

Conteúdo do Curso

Introduction to GoLang

Introduction to GoLang

1. Getting Started
2. Data Types
3. Control Structures
4. Functions
5. Arrays and Slices
6. Intro to Structs & Maps

book
Challenge: Creating a Structure

Task

Create a structure named Car with fields company, owner, miles, and year in the same order. Assign appropriate data types to them based on the provided code.

go

index

copy
12345678910111213141516
package main import "fmt" // Write code below this line // Write code above this line func main() { var car1 Car car1.company = "Tesla" car1.owner = "Tegmark" car1.miles = 10.7 car1.year = 2021 fmt.Println(car1) }
What is the data type assigned to the `miles` field in the `Car` structure?

What is the data type assigned to the miles field in the Car structure?

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 6. Capítulo 8
We're sorry to hear that something went wrong. What happened?
some-alt