github.com/tonkpils/cli@v1.6.2/fetch_endpoint.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  func FetchEndpoint(args []string) string {
     8  	if len(args) == 0 {
     9  		return FetchEndpoints["current"]
    10  	}
    11  
    12  	endpoint := FetchEndpoints["exercise"]
    13  	for _, arg := range args {
    14  		endpoint = fmt.Sprintf("%s/%s", endpoint, arg)
    15  	}
    16  
    17  	return endpoint
    18  }