Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
nit: return concrete types
Browse files Browse the repository at this point in the history
This is generally considered the "better" way to do things in go. It also allows
us to expose functions like `request` at some point without changing the API
interface itself.
  • Loading branch information
Stebalien committed Mar 29, 2019
1 parent 7f25b2a commit 524e5d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type HttpApi struct {
//
// Daemon api address is pulled from the $IPFS_PATH/api file.
// If $IPFS_PATH env var is not present, it defaults to ~/.ipfs
func NewLocalApi() (iface.CoreAPI, error) {
func NewLocalApi() (*HttpApi, error) {
baseDir := os.Getenv(EnvDir)
if baseDir == "" {
baseDir = DefaultPathRoot
Expand All @@ -50,7 +50,7 @@ func NewLocalApi() (iface.CoreAPI, error) {

// NewPathApi constructs new HttpApi by pulling api address from specified
// ipfspath. Api file should be located at $ipfspath/api
func NewPathApi(ipfspath string) (iface.CoreAPI, error) {
func NewPathApi(ipfspath string) (*HttpApi, error) {
a, err := ApiAddr(ipfspath)
if err != nil {
if os.IsNotExist(err) {
Expand Down

0 comments on commit 524e5d8

Please sign in to comment.