User Program Communication

Import Libraries in Go

Used to import libraries with built in functions and classes.


Syntax
import {
    "library_name"
}

//using a library member
library_name.library_function

Notes

Once libraries are imported, their functions and classes can be referenced within the library name.


Example
package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, world!") //the PrintLn function belongs to the fmt library
}

Add to Slack

< Write to FIle   |   Package Clause >

© 2019 SyntaxDB. All Rights Reserved.