Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
23
Task/Distributed-programming/Go/distributed-programming-2.go
Normal file
23
Task/Distributed-programming/Go/distributed-programming-2.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/rpc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := rpc.DialHTTP("tcp", "localhost:1234")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
amount := 3.
|
||||
var tax float64
|
||||
err = client.Call("TaxComputer.Tax", amount, &tax)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("Tax on %.2f: %.2f\n", amount, tax)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue