mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-16 02:01:16 +00:00
first
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Same Line Declarations
|
||||
|
||||
We are able to declare multiple variables on the same line:
|
||||
|
||||
```go
|
||||
mileage, company := 80276, "Tesla"
|
||||
|
||||
// is the same as
|
||||
|
||||
mileage := 80276
|
||||
company := "Tesla"
|
||||
```
|
||||
## Assignment
|
||||
|
||||
Within the main function, declare a float called `averageOpenRate` and string called `displayMessage` on the same line.
|
||||
|
||||
Initialize them to values of `.23` and `is the average open rate of your messages` respectively before they are printed.
|
||||
Reference in New Issue
Block a user