mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-18 19:21:17 +00:00
first
This commit is contained in:
32
course/4-structs/exercises/5-methods/code.go
Normal file
32
course/4-structs/exercises/5-methods/code.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type authenticationInfo struct {
|
||||
username string
|
||||
password string
|
||||
}
|
||||
|
||||
// ?
|
||||
|
||||
// don't touch below this line
|
||||
|
||||
func test(authInfo authenticationInfo) {
|
||||
fmt.Println(authInfo.getBasicAuth())
|
||||
fmt.Println("====================================")
|
||||
}
|
||||
|
||||
func main() {
|
||||
test(authenticationInfo{
|
||||
username: "Google",
|
||||
password: "12345",
|
||||
})
|
||||
test(authenticationInfo{
|
||||
username: "Bing",
|
||||
password: "98765",
|
||||
})
|
||||
test(authenticationInfo{
|
||||
username: "DDG",
|
||||
password: "76921",
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user