Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6835543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:14:42+00:00 2026-05-26T23:14:42+00:00

Hi there I just want to create a simple golang applications, which posts a

  • 0

Hi there I just want to create a simple golang applications, which posts a new dent at identi.ca using

curl -u username:password http://example.com/api/statuses/update.xml -d status='Howdy!' -d lat='30.468' -d long='-94.743'

This is my code so far and imho this should work, but actually it isn’t working, does anybody know how to fix this?

EDIT: Nope: I don’t get any error messages :/

package main

import(
        "fmt"
        "os"
        "bufio"
        "exec"
)
func main() {

var err os.Error
var username string

print("Username: ")
_, err = fmt.Scanln(&username)
if err != nil {
    fmt.Println("Error: ", err)
}

var password string
print("Password: ")
_, err = fmt.Scanln(&password)
if err != nil {
    fmt.Println("Error: ", err)
}

var status string
print("Status: ")
in := bufio.NewReader(os.Stdin);
status, err = in.ReadString('\n');
if err != nil {
    fmt.Println("Error: ", err)
}

exec.Command("curl -u " + username + ":" + password + "https://identi.ca/api/statuses/update.xml -d status='" + status +  "'" + "-d source='API'").Run()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:14:42+00:00Added an answer on May 26, 2026 at 11:14 pm

    exec.Command() doesn’t take the whole command line as a single argument. You need to call it as:

    exec.Command("curl", "-u", username+":"+password, ...url..., "-d", "status="+status, "-d", "source=API").Run()
    

    How do you know if you get an error? You don’t check the return value of Run().

    You should actually separate the command creation from running it. This way you can set the process’s stdout and stderr to something besides /dev/null, e.g.

    c := exec.Command("curl", "-u", username+":"+password, "https://identi.ca/api/statuses/update.xml", "-d", "status="+status, "-d", "source=API")
    c.Stdout = os.Stdout
    c.Stderr = os.Stderr
    err = c.Run()
    if err != nil {
        fmt.Println("Error: ", err)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to design this very simple website. Basically there are multiple pages
I am using sql server 2005. I just want to know is there something
Just I am new to Object Modelling.I want to know still there is a
I want to create a simple application using Jena and SPARQL, that inserts, deletes,
In short, I want to create a simple video player which can play some
I want to create a very simple spell checker using a text file with
I want to create a simple Mac application bundle which calls a simple Python
I just want to know if there is a program that can convert an
Just want to know if there other optional wrapper framework available that generate client
my app accesses the internet and i just want to detect whether there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.