---
title: "Discussion on \"The Three Dots In Golang...\" | Hashnode"
description: "Discussion on \"The Three Dots In Golang...\". Understand the various use cases of the three dots in the Go Language."
url: "https://hashnode.com/posts/the-three-dots-in-golang/61177d0af6ebde51f64fa331"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Three Dots In Golang...](https://blog.harishdurga.com/the-three-dots-in-golang?utm_source=hashnode&utm_medium=feed)

Understand the various use cases of the three dots in the Go Language.

Aug 14, 2021 · 2 min read · blog.harishdurga.com  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#programming-languages](https://hashnode.com/tag/programming-languages)

## Written by

[Harish Durga](https://hashnode.com/@harishd)

@harishd · Bengaluru, India

  
[View profile](https://hashnode.com/@harishd)

Full Stack Dev. I share my learnings.

I am full stack developer. I work on fun projects in my free time. At present my primary tech stack is Laravel and Vue js. I am in the process of expanding my tech stack. Go, Python, Cloud, Rust etc.

## Responses 1

Markdown supported · ⌘↵ to post

[Lukas Gaučas](https://hashnode.com/@projektorius96)

[Dec 20, 2022](https://hashnode.com/posts/the-three-dots-in-golang/61177d0af6ebde51f64fa331/comment/63a241a6a59cad9bdbba38cb)

Nice one ! Also consider example with simple [under(lying) type](https://replit.com/@projektorius96/purefunctions#variadic_funcs.go)

```
package main

import (
    . "fmt"
)

type under int

// Based on (but with underlying type) : @blog.harishdurga.com/the-three-dots-in-golang
// define ...rest like parameter for variadic functions
func Sum(nums ...under) under {
    var r under = 0
    for _, n := range nums {
        r += n
    }
    return under(r)
}

func main() {
    /* Println( Sum([]int{1,2,3}...) ) */// instead do:
    Println( Sum([]under{1,2,3}...) )
}
```
