# Import package (third party) from GitHub

**Description**\
This guide assumes that you already have created your own package in **go** and uploaded on GitHub, if you haven't then checkout [create a package in go](https://shariqahmkhan.gitbook.io/learngo/how-to-guide/create-a-package-in-go) and [upload package to GitHub](https://shariqahmkhan.gitbook.io/learngo/how-to-guide/upload-package-to-github). For demonstration we will use package uploaded [here](https://github.com/shariqkhan29/GoModule).

**Explanation**\
The package, in the repository [here](https://github.com/shariqkhan29/GoModule) (GoModule.go) uploaded on GitHub, consist of a function name **hello** which takes string argument and returns a formatted message along with string.&#x20;

```
// package hosted on GitHub
package greetings

import "fmt"

// Hello returns a greeting for the named person.
func Hello(name string) string {
    // Return a greeting that embeds the name in a message.
    message := fmt.Sprintf("Hi, %v. Welcome!", name)
    return message
}
```

Below is our main package (In Go, application code that must be executed should be main package), where we must import and use function from the third party package (package other than standard library are called third party, in this case it is our package hosted on GitHub)

```
package main

import (
    "fmt"

    // we import the package here
    "github.com/shariqkhan29/GoModule"  
)

func main() {
    // Get a greeting message and print it.
    message := greetings.Hello("Gladys")
    fmt.Println(message)
}
```

Now, type **go run .** in your command prompt you should see output as below

![](/files/-MZ6ceYdEdGktFKWGdMP)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learngo.edugated.com/how-to-guide/import-package-third-party-from-github.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
