查看某一个buildin包里面的函数:godoc buildin,例如查看http包文档,那么执行: godoc net/http 执行 godoc fmt Printf, 可以查看相应的代码 执行 godoc -src fmt Printf, 可以查看相应的代码
通过命令在命令行执行 godoc -http=:端口号 比如godoc -http=:8080。然后在浏览器中打开127.0.0.1:8080,你将会看到一个golang.org的本地copy版本
<?php | |
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ | |
/*:: :*/ | |
/*:: This routine calculates the distance between two points (given the :*/ | |
/*:: latitude/longitude of those points). It is being used to calculate :*/ | |
/*:: the distance between two locations using GeoDataSource(TM) Products :*/ | |
/*:: :*/ | |
/*:: Definitions: :*/ | |
/*:: South latitudes are negative, east longitudes are positive :*/ |
<?php | |
/* | |
| path: app/start/global.php | |
|-------------------------------------------------------------------------- | |
| Register The Laravel Class Loader | |
|-------------------------------------------------------------------------- | |
| | |
| In addition to using Composer, you may use the Laravel class loader to | |
| load your controllers and models. This is useful for keeping all of |
<?php | |
include 'src/HessianClient.php'; | |
$fp = fopen(dirname(__FILE__).'/unit_tests/ok.png', "r"); | |
$options = new HessianOptions(); | |
$options->version = 2; | |
$options->transport = "http"; | |
// hessian server address |
<?php | |
// app/controllers/HomeController.php | |
class HomeController extends BaseController { | |
// method for client to call | |
function getFile($file) | |
{ | |
return $file . ' hessian'; | |
//return $file; |
<?php | |
// app/commands/NewCommand.php | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class NewCommand extends Command { | |
/** |
# build soft link between files under sites-available and sites-enabled | |
ln -s /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/test.com | |
service nginx restart |
查看某一个buildin包里面的函数:godoc buildin,例如查看http包文档,那么执行: godoc net/http 执行 godoc fmt Printf, 可以查看相应的代码 执行 godoc -src fmt Printf, 可以查看相应的代码
通过命令在命令行执行 godoc -http=:端口号 比如godoc -http=:8080。然后在浏览器中打开127.0.0.1:8080,你将会看到一个golang.org的本地copy版本
Go语言里面定义变量有多种方式。 | |
使用var关键字是Go最基本的定义变量方式,与C语言不同的是Go把变量类型放在变量名后面: | |
//定义一个名称为“variableName”,类型为"type"的变量 | |
var variableName type | |
定义多个变量 | |
//定义三个类型都是“type”的三个变量 | |
var vname1, vname2, vname3 type |
# assume vsftpd installed | |
# add a user called `ftpuser`, home dir is "/var/www/html/example.com" | |
useradd -d /var/www/html/example.com -s /usr/sbin/nologin ftpuser | |
# add passowrd for ftpuser | |
passwd ftpuser | |
# | |
chown -R ftpuser:ftpuser /var/www/html/example.com |
<?php | |
/** | |
* Path to the 'app' folder | |
*/ | |
echo app_path(); | |
/** | |
* Path to the project's root folder | |
*/ | |
echo base_path(); | |
/** |