在Go语言中附加系统路径

时间:2016-07-15 04:20:48

标签: python go

我有python代码

import sys
sys.path.append("/usr/local/py")

如何使用go语言转换此代码?如何将路径追加到系统路径?

1 个答案:

答案 0 :(得分:1)

Go在编译时创建静态链接的二进制文件。最接近的等价物是设置您的GOPATH环境变量以搜索该目录。通常,在设置环境时导出该变量,以便知道在哪里查找包。您可以根据需要为<?php //Database Connection $conn = new mysqli('127.0.0.1', 'mobileki_factum', '%bq41214xA5&}wp)o','mobileki_amit'); if ($mysqli->connect_error) { die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); } $sql1="select "; $code=$_POST['code']; if(isset($_POST["submit"])){ $query = "SELECT * FROM `mobileki_amit`.`activations` WHERE code='$code' AND status='not used'"; $result=$conn->query($query); if($result->num_rows > 0) { $fname=$_POST['fname']; $email=$_POST['email_address']; $contact=$_POST['contact_number']; $gender=$_POST['gender']; $location=$_POST['location']; $stander=$_POST['standard']; $institute=$_POST['institute']; $code=$_POST['code']; $sql1="INSERT INTO `students`(`full_name`, `email_address`, `contact_number`, `gender`, `location`, `standard`, `institute`) VALUES('$fname','$email','$contact','$gender','$location','$stander','$institute');"; if($conn->query($sql1)===TRUE){ echo "new recored is successful AND"; $mysql_query="UPDATE `activations` SET `status` = 'in use' WHERE `CODE` = '$code'"; // or die(mysql_error()); if($conn->query($mysql_query)===TRUE){ echo "recored is updated successful"; } else { echo "no recored updated "; } } else{ echo "not able to insert"; } when trying to run this i am getting a blank output neither it shows any error nor the data is being inserted.Can anyone tell me where iam getting wrong? 追加多个目录,它将搜索模块的那些路径。