Join David Gassner for an in-depth discussion in this video Working with string values, part of Learning Go.
- A string-and-go can be treated either as a single,…simple value or as an array of bytes.…As with all types, you can declare a string value…either implicitly, or explicitly.…I'll start by declaring a variable named str1,…and I will use implicit typing with the := operator,…and I'll set it to a value of "An implicitly typed string".…The I'll output the value with fmt.Println,…and then the value.…
I'll save and then I'll run that code.…And I get the value "An implicitly typed string".…If I want to see the actual type, I can use "Printf"…instead, and then a string with verbs.…I'll use two verbs, %v for the value, and then after…a literal colon, %T for the type, and then I'll need to…pass in the value twice, once for each verb.…
And now I see the name of the variable from my literal,…and then the value of the variable "An implicitly typed…string", and then after the colon, the actual data type.…I'll be sure to include a line feed at the end of…this string because I'll be outputting multiple strings…to the console in this exercise.…
- Installing Go tools
- Creating and compiling a Go workspace
- Exploring variables, constants, and types
- Storing ordered and unordered values
- Grouping related values in structs
- Programming conditional logic and loops
- Defining and calling functions
- Handling errors
- Working with files
- Creating a simple HTTP server
Skill Level Beginner
1. Getting Started
2. Essential Go Skills
3. Managing Simple Values
4. Managing Complex Types and Collections
5. Managing Program Flow
6. Structuring Go Code
7. Working with Files and the Web
Next steps2m 26s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.